summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Tooling/RecursiveASTVisitorTest.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-08-17 21:23:17 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-08-17 21:23:17 +0000
commit87deab3e6c1650351049c6cf763edbc17e380dcc (patch)
tree07a87d3583531afa423c1a3041b28c8ac63e8727 /clang/unittests/Tooling/RecursiveASTVisitorTest.cpp
parent0731affaca7eecb4c3b0a35d6b459e1cf661b38d (diff)
downloadbcm5719-llvm-87deab3e6c1650351049c6cf763edbc17e380dcc.tar.gz
bcm5719-llvm-87deab3e6c1650351049c6cf763edbc17e380dcc.zip
Part of PR13618: visit the TypeLoc when RecursiveASTVisitor visits a CompoundLiteralExpr.
llvm-svn: 162133
Diffstat (limited to 'clang/unittests/Tooling/RecursiveASTVisitorTest.cpp')
-rw-r--r--clang/unittests/Tooling/RecursiveASTVisitorTest.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/unittests/Tooling/RecursiveASTVisitorTest.cpp b/clang/unittests/Tooling/RecursiveASTVisitorTest.cpp
index 4b539067b13..1952c7b2118 100644
--- a/clang/unittests/Tooling/RecursiveASTVisitorTest.cpp
+++ b/clang/unittests/Tooling/RecursiveASTVisitorTest.cpp
@@ -392,4 +392,12 @@ TEST(RecursiveASTVisitor, VisitsExtension) {
"int s = __extension__ (s);\n"));
}
+TEST(RecursiveASTVisitor, VisitsCompoundLiteralType) {
+ TypeLocVisitor Visitor;
+ Visitor.ExpectMatch("struct S", 1, 26);
+ EXPECT_TRUE(Visitor.runOver(
+ "int f() { return (struct S { int a; }){.a = 0}.a; }",
+ TypeLocVisitor::Lang_C));
+}
+
} // end namespace clang
OpenPOWER on IntegriCloud