* template4.C: New test.
authorAlexandre Oliva <oliva@dcc.unicamp.br>
Tue, 13 Jul 1999 10:39:58 +0000 (10:39 +0000)
committerAlexandre Oliva <oliva@gcc.gnu.org>
Tue, 13 Jul 1999 10:39:58 +0000 (10:39 +0000)
From-SVN: r28085

gcc/testsuite/g++.old-deja/g++.oliva/ChangeLog
gcc/testsuite/g++.old-deja/g++.oliva/template4.C [new file with mode: 0644]

index e83c32c1a908c27472924aaa21bfbc7f1cbca609..a9cedf5c8d6c19fdd0beccd097b73b1ccdfd51be 100644 (file)
@@ -1,5 +1,7 @@
 1999-07-13  Alexandre Oliva  <oliva@dcc.unicamp.br>
 
+       * template4.C: New test.
+
        * expr1.C: New test.
 
        * partspec1.C: New test.
diff --git a/gcc/testsuite/g++.old-deja/g++.oliva/template4.C b/gcc/testsuite/g++.old-deja/g++.oliva/template4.C
new file mode 100644 (file)
index 0000000..5d7f7a6
--- /dev/null
@@ -0,0 +1,20 @@
+// Build don't link:
+
+// Copyright (C) 1999 Free Software Foundation
+
+// by Alexandre Oliva <oliva@dcc.unicamp.br>
+// based on bug report by Andrey Slepuhin <pooh@msu.ru>
+
+template <const int&> struct X {};
+
+int a = 1;
+X<a> x; // ok, a has external linkage
+
+const int b = 2;
+X<b> y; // ERROR - const b has internal linkage
+
+extern const int c;
+X<c> z; // ok, c has external linkage
+
+extern const int c = 3;
+X<c> z_; // gets bogus error - using c as constant - XFAIL *-*-*