summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/parse/parse6.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/parse/parse6.C')
-rw-r--r--gcc/testsuite/g++.dg/parse/parse6.C31
1 files changed, 31 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/parse/parse6.C b/gcc/testsuite/g++.dg/parse/parse6.C
new file mode 100644
index 000000000..73f7256d3
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/parse6.C
@@ -0,0 +1,31 @@
+/* PR c++/3012 */
+/* { dg-do compile } */
+
+class A
+{
+ public:
+
+ template <class T>
+ void foo() const
+ {
+ }
+};
+
+template <class T>
+class B
+{
+ public:
+
+ void bar(const A& a) const
+ {
+ // Compile used to fail with parse error before `;' token
+ a.foo<double>();
+ }
+};
+
+int main()
+{
+ A a;
+ B<int> b;
+ b.bar(a);
+}