mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-28 22:36:05 +00:00
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:
parent
b1248ffe9d
commit
951006f510
@ -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)) {
|
||||
|
@ -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() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user