diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/template/dependent-expr2.C')
-rw-r--r-- | gcc/testsuite/g++.dg/template/dependent-expr2.C | 23 |
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 000000000..06f056b41 --- /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 "" "" } + } +}; |