We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7ea103d commit f85a6a8Copy full SHA for f85a6a8
clang/unittests/AST/DeclTest.cpp
@@ -157,3 +157,17 @@ TEST(Decl, EnumDeclRange) {
157
EXPECT_EQ(SM.getFileOffset(BarRange.getBegin()), Code.range().Begin);
158
EXPECT_EQ(SM.getFileOffset(BarRange.getEnd()), Code.range().End);
159
}
160
+
161
+TEST(Decl, IsInExportDeclContext) {
162
+ llvm::Annotations Code(R"(
163
+ export module m;
164
+ export template <class T>
165
+ void f() {})");
166
+ auto AST =
167
+ tooling::buildASTFromCodeWithArgs(Code.code(), /*Args=*/{"-std=c++20"});
168
+ ASTContext &Ctx = AST->getASTContext();
169
170
+ const auto *f =
171
+ selectFirst<FunctionDecl>("f", match(functionDecl().bind("f"), Ctx));
172
+ EXPECT_TRUE(f->isInExportDeclContext());
173
+}
0 commit comments