Have __has_nothrow_copy use Sema's lookup routines. This fixes the problem with not finding implicitly declared copy constructors, part of PR8107.

llvm-svn: 113784
This commit is contained in:
Sebastian Redl 2010-09-13 21:10:20 +00:00
parent b1248ffe9d
commit 951006f510
2 changed files with 2 additions and 1 deletions

View File

@ -2148,7 +2148,7 @@ static bool EvaluateUnaryTypeTrait(Sema &Self, UnaryTypeTrait UTT, QualType T) {
DeclarationName ConstructorName
= C.DeclarationNames.getCXXConstructorName(C.getCanonicalType(T));
DeclContext::lookup_const_iterator Con, ConEnd;
for (llvm::tie(Con, ConEnd) = RD->lookup(ConstructorName);
for (llvm::tie(Con, ConEnd) = Self.LookupConstructors(RD);
Con != ConEnd; ++Con) {
CXXConstructorDecl *Constructor = cast<CXXConstructorDecl>(*Con);
if (Constructor->isCopyConstructor(FoundTQs)) {

View File

@ -366,6 +366,7 @@ void has_nothrow_copy() {
int t21[T(__has_nothrow_copy(HasMultipleNoThrowCopy))];
int t22[F(__has_nothrow_copy(void))];
int t23[F(__has_nothrow_copy(cvoid))];
int t24[T(__has_nothrow_copy(HasVirtDest))];
}
void has_nothrow_constructor() {