зеркало из https://github.com/microsoft/clang-1.git
When looking for a copy-assignment operator to determine the cv-qualifiers on its argument type, ignore assignment operator templates
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85629 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
259571e27e
Коммит
682054c52e
|
@ -189,7 +189,10 @@ bool CXXRecordDecl::hasConstCopyAssignment(ASTContext &Context,
|
|||
// A user-declared copy assignment operator is a non-static non-template
|
||||
// member function of class X with exactly one parameter of type X, X&,
|
||||
// const X&, volatile X& or const volatile X&.
|
||||
const CXXMethodDecl* Method = cast<CXXMethodDecl>(*Op);
|
||||
const CXXMethodDecl* Method = dyn_cast<CXXMethodDecl>(*Op);
|
||||
if (!Method)
|
||||
continue;
|
||||
|
||||
if (Method->isStatic())
|
||||
continue;
|
||||
if (Method->getPrimaryTemplate())
|
||||
|
|
|
@ -34,3 +34,19 @@ void test3(X<int> &x, X<int> xi, X<long> xl, X<int Y::*> xmptr) {
|
|||
x = xl;
|
||||
x = xmptr; // expected-note{{instantiation}}
|
||||
}
|
||||
|
||||
struct X1 {
|
||||
X1 &operator=(const X1&);
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
struct X2 : X1 {
|
||||
template<typename U> X2 &operator=(const U&);
|
||||
};
|
||||
|
||||
struct X3 : X2<int> {
|
||||
};
|
||||
|
||||
void test_X2(X3 &to, X3 from) {
|
||||
to = from;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче