summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2017-10-10 21:07:44 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2017-10-10 21:07:44 +0000
commitdecaff11aae7708efe3eefb5ad4612ad0919b7a7 (patch)
treeb3f76dc9a9e6a89462cfbd4069fa6a626fb4f931
parentad3d03193ad4f9d62da3337667369bf483c0edac (diff)
downloadbcm5719-llvm-decaff11aae7708efe3eefb5ad4612ad0919b7a7.tar.gz
bcm5719-llvm-decaff11aae7708efe3eefb5ad4612ad0919b7a7.zip
Add test for regression caused by reverted patch r315251.
llvm-svn: 315366
-rw-r--r--clang/test/SemaCXX/linkage2.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/linkage2.cpp b/clang/test/SemaCXX/linkage2.cpp
index 8c80f4bdb90..6f43af39f7c 100644
--- a/clang/test/SemaCXX/linkage2.cpp
+++ b/clang/test/SemaCXX/linkage2.cpp
@@ -218,3 +218,34 @@ namespace PR18964 {
unsigned &*foo; //expected-error{{'foo' declared as a pointer to a reference of type}}
extern struct {} *foo; // don't assert
}
+
+namespace typedef_name_for_linkage {
+ template<typename T> struct Use {};
+
+ struct A { A(); A(const A&); ~A(); };
+
+ typedef struct {
+ A a;
+ } B;
+
+ struct C {
+ typedef struct {
+ A a;
+ } D;
+ };
+
+ typedef struct {
+ void f() { static int n; struct Inner {};}
+ } E;
+
+ // FIXME: Ideally this would be accepted in all modes. In C++98, we trigger a
+ // linkage calculation to drive the "internal linkage type as template
+ // argument" warning.
+ typedef struct {
+ void f() { struct Inner {}; Use<Inner> ui; }
+ } F;
+#if __cplusplus < 201103L
+ // expected-error@-2 {{unsupported: typedef changes linkage of anonymous type, but linkage was already computed}}
+ // expected-note@-5 {{use a tag name here}}
+#endif
+}
OpenPOWER on IntegriCloud