File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
clang/unittests/Analysis/Scalable Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 99#include " clang/Analysis/Scalable/ASTEntityMapping.h"
1010#include " clang/AST/ASTContext.h"
1111#include " clang/AST/Decl.h"
12+ #include " clang/AST/DeclCXX.h"
1213#include " clang/ASTMatchers/ASTMatchFinder.h"
1314#include " clang/ASTMatchers/ASTMatchers.h"
1415#include " clang/Tooling/Tooling.h"
@@ -107,13 +108,16 @@ TEST(ASTEntityMappingTest, ImplicitDecl) {
107108 ASSERT_NE (RD, nullptr );
108109
109110 // Find the implicitly-declared copy constructor
111+ const CXXConstructorDecl * ImplCtor = nullptr ;
110112 for (const auto *Ctor : RD->ctors ()) {
111113 if (Ctor->isCopyConstructor () && Ctor->isImplicit ()) {
112- auto EntityName = getLocalEntityNameForDecl (Ctor);
113- EXPECT_FALSE (EntityName.has_value ());
114- return ;
114+ ImplCtor = Ctor;
115+ break ;
115116 }
116117 }
118+
119+ auto EntityName = getLocalEntityNameForDecl (ImplCtor);
120+ EXPECT_FALSE (EntityName.has_value ());
117121}
118122
119123TEST (ASTEntityMappingTest, BuiltinFunction) {
You can’t perform that action at this time.
0 commit comments