diff options
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/ChangeLog | 2 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/diag1.C | 32 |
2 files changed, 34 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 51f8de9..bcf800a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,7 @@ 2011-07-04 Jason Merrill <jason@redhat.com> + * g++.dg/cpp0x/diag1.C: New. + * g++.dg/diagnostic/aka1.C: New. 2011-07-04 Jakub Jelinek <jakub@redhat.com> diff --git a/gcc/testsuite/g++.dg/cpp0x/diag1.C b/gcc/testsuite/g++.dg/cpp0x/diag1.C new file mode 100644 index 0000000..b3f30bc --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/diag1.C @@ -0,0 +1,32 @@ +// { dg-options -std=c++0x } + +template <int U> +struct TypeA +{ + typedef int type; +}; + +template <int N> +struct TypeB +{ + template <int U> typename TypeA<U>::type fn(); +}; + +struct TypeC +{ + TypeB<10> b; + // This was being printed as: + // template<int N> + // decltype (((TypeC*)this)-> + // TypeC::b. + // template<int U> typename TypeA<U>::type TypeB::fn [with int U = U, int N = 10, typename TypeA<U>::type = TypeA<U>::type]()) + // TypeC::fn() + // we don't want to see the template header, return type, or parameter bindings + // for TypeB::fn. + template <int N> auto fn() -> decltype(b.fn<N>()); // { dg-bogus "typename|with" } +}; + +int main() +{ + TypeC().fn<4>(1); // { dg-error "no match" } +} |