aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/template/dependent-expr2.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/template/dependent-expr2.C')
-rw-r--r--gcc/testsuite/g++.dg/template/dependent-expr2.C23
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/template/dependent-expr2.C b/gcc/testsuite/g++.dg/template/dependent-expr2.C
new file mode 100644
index 00000000000..9c9d5f96673
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/dependent-expr2.C
@@ -0,0 +1,23 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 2 Aug 2003 <nathan@codesourcery.com>
+
+// PR 11704. ICE
+
+struct A
+{
+ int foo()
+ {
+ return 5;
+ }
+};
+
+template <class T> // If B is not template it works
+struct B
+{
+ bool bar(A& a)
+ {
+ return a.foo == 0; // { dg-error "insufficient context" "" }
+ }
+};