aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCXX/anonymous-struct.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaCXX/anonymous-struct.cpp')
-rw-r--r--test/SemaCXX/anonymous-struct.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/SemaCXX/anonymous-struct.cpp b/test/SemaCXX/anonymous-struct.cpp
index 8a61041463ba..1b5dc13cea01 100644
--- a/test/SemaCXX/anonymous-struct.cpp
+++ b/test/SemaCXX/anonymous-struct.cpp
@@ -14,3 +14,10 @@ struct E {
static struct {
};
};
+
+template <class T> void foo(T);
+typedef struct { // expected-note {{use a tag name here to establish linkage prior to definition}} expected-note {{declared here}}
+ void test() {
+ foo(this); // expected-warning {{template argument uses unnamed type}}
+ }
+} A; // expected-error {{unsupported: typedef changes linkage of anonymous type, but linkage was already computed}}