aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/nolinkage1.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/g++.dg/cpp0x/nolinkage1.C')
-rw-r--r--gcc-4.9/gcc/testsuite/g++.dg/cpp0x/nolinkage1.C21
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/nolinkage1.C b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/nolinkage1.C
new file mode 100644
index 0000000..d38028c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/nolinkage1.C
@@ -0,0 +1,21 @@
+// DR 757 allows using types without linkage in declarations with linkage.
+// Test that this doesn't lead to link-time collisions.
+
+// { dg-additional-sources "nolinkage1a.cc" }
+// { dg-do link { target c++11 } }
+
+#include "nolinkage1.h"
+
+typedef struct { int i; } *AP;
+
+void f(AP) { }
+
+A<AP> a;
+
+static void g()
+{
+ struct B { };
+ A<B> a;
+}
+
+int main() { g(); f(0); }