Another Membertemplate bug.
Klaus-Georg Adams
Klaus-Georg.Adams@chemie.uni-karlsruhe.de
Mon Nov 23 03:13:00 GMT 1998
The attached testcase fails with parse errors at the assignments to j
and k although it should compile.
This applies to the release branch as well as to the trunk.
-- kga
-------------------------------------------------------------------------
Klaus-Georg Adams Email: Klaus-Georg.Adams@chemie.uni-karlsruhe.de
Institut f. Anorg. Chemie, Lehrstuhl II Tel: 49(0)721 608 3485
Universität Karlsruhe, D-76128 Karlsruhe
-------------------------------------------------------------------------
--- /dev/null Mon Jul 18 01:46:18 1994
+++ gcc/testsuite/g++.old-deja/g++.pt/memtemp80.C Fri Nov 20 17:28:09 1998
@@ -0,0 +1,16 @@
+// Build don't link:
+
+template<typename T> T baz() { return 0; }
+
+struct foo {
+ template<typename T> static T staticbar() { return 0; }
+ template<typename T> T bar() { return 0; }
+};
+
+void f()
+{
+ foo t;
+ int i = baz<int>(); // works
+ int j = foo::staticbar<int>(); // fails
+ int k = t.bar<int>(); // fails
+}
More information about the Gcc-bugs
mailing list