]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/13407 (Confusing error message from extraneous typename)
authorGiovanni Bajo <giovannibajo@gcc.gnu.org>
Fri, 16 Jan 2004 12:33:28 +0000 (12:33 +0000)
committerGiovanni Bajo <giovannibajo@gcc.gnu.org>
Fri, 16 Jan 2004 12:33:28 +0000 (12:33 +0000)
PR c++/13407
* g++.dg/parse/typename6.C: New test.

From-SVN: r75970

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/parse/typename6.C [new file with mode: 0644]

index 196bce820a0738402c1231e07191c79ba2a4b296..3136eda9d74c1505cf8afc3023bfc2414c13a865 100644 (file)
@@ -1,3 +1,8 @@
+2004-01-15  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
+
+       PR c++/13407
+       * g++.dg/parse/typename6.C: New test.
+
 2004-01-15  Geoffrey Keating  <geoffk@apple.com>
 
        PR pch/13361
diff --git a/gcc/testsuite/g++.dg/parse/typename6.C b/gcc/testsuite/g++.dg/parse/typename6.C
new file mode 100644 (file)
index 0000000..a0f5e39
--- /dev/null
@@ -0,0 +1,17 @@
+// { dg-do compile }\r
+// Contributed by Matt Austern <austern at apple dot com>\r
+// PR c++/13407: Gracefully handle keyword typename in base class specifier.\r
+\r
+struct A { };\r
+struct B { typedef A Type; };\r
+\r
+template <typename T>\r
+struct X : \r
+  public typename T::Type  // { dg-error "not allowed in this context" }\r
+{ };\r
+\r
+X<B> x;\r
+\r
+struct C : \r
+  public typename A        // { dg-error "not allowed outside of templates" }\r
+{ };\r