Skip to content

Commit d23f381

Browse files
committed
Add test for AttributedTypeLoc
1 parent 4239775 commit d23f381

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

clang-tools-extra/clangd/unittests/SelectionTests.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -313,13 +313,13 @@ TEST(SelectionTest, CommonAncestor) {
313313
{"[[void ^foo()]];", "FunctionDecl"},
314314
// Tricky case: with function attributes, the AttributedTypeLoc's range
315315
// includes the function name, but we want the name to be associated with
316-
// the FunctionDecl.
317-
{"struct X { [[void ^foo() [[clang::lifetimebound]]]]; };",
318-
"FunctionDecl"},
319-
{"struct X { [[void ^foo() const [[clang::lifetimebound]]]]; };",
320-
"FunctionDecl"},
321-
{"struct X { [[const int* ^Get() const [[clang::lifetimebound]]]]; };",
322-
"FunctionDecl"},
316+
// the CXXMethodDecl.
317+
{"struct X { [[const int* ^Get() const <:[clang::lifetimebound]:> "
318+
"{return nullptr;}]]; };",
319+
"CXXMethodDecl"},
320+
{"struct X { const [[int* Foo() const <:[clang::life^timebound]:>]] "
321+
"{return nullptr;}; };",
322+
"AttributedTypeLoc"},
323323
// Tricky case: two VarDecls share a specifier.
324324
{"[[int ^a]], b;", "VarDecl"},
325325
{"[[int a, ^b]];", "VarDecl"},

0 commit comments

Comments
 (0)