diff options
author | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-11-09 17:53:24 +0000 |
---|---|---|
committer | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-11-09 17:53:24 +0000 |
commit | d60932ce39c05fbe212b3c8e641fcf34fc27e84f (patch) | |
tree | 0825fc6c3dbe77f71df1d622946be2e8079c0d7d /gcc | |
parent | 1d7a22e6a9660e6d3c660acd01ab2ee1c0e61290 (diff) | |
download | gcc-d60932ce39c05fbe212b3c8e641fcf34fc27e84f.tar.gz |
* pt.c (invalid_nontype_parm_type_p): Avoid printing "<type error>".
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@181220 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 2 | ||||
-rw-r--r-- | gcc/cp/pt.c | 8 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/variadic74.C | 4 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/template/crash53.C | 2 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/template/void9.C | 2 |
6 files changed, 19 insertions, 5 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 095f671f51e..03ffecec7bf 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,7 @@ 2011-11-09 Jason Merrill <jason@redhat.com> + * pt.c (invalid_nontype_parm_type_p): Avoid printing "<type error>". + * pt.c (convert_nontype_argument): Only integral arguments get early folding. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index a804fda494a..71a98b0de19 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -18976,7 +18976,13 @@ invalid_nontype_parm_type_p (tree type, tsubst_flags_t complain) return 0; if (complain & tf_error) - error ("%q#T is not a valid type for a template constant parameter", type); + { + if (type == error_mark_node) + inform (input_location, "invalid template non-type parameter"); + else + error ("%q#T is not a valid type for a template non-type parameter", + type); + } return 1; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 691711d2774..ef4b175d4d7 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2011-11-09 Jason Merrill <jason@redhat.com> + + * g++.dg/cpp0x/variadic74.C: Adjust diags. + * g++.dg/template/crash53.C: Likewise. + * g++.dg/template/void9.C: Likewise. + 2011-11-09 Paolo Carlini <paolo.carlini@oracle.com> PR c++/51045 diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic74.C b/gcc/testsuite/g++.dg/cpp0x/variadic74.C index 19b6b11d8e2..5b502b974cc 100644 --- a/gcc/testsuite/g++.dg/cpp0x/variadic74.C +++ b/gcc/testsuite/g++.dg/cpp0x/variadic74.C @@ -1,8 +1,8 @@ -// { dg-options "-std=gnu++0x" } +// { dg-do compile { target c++11 } } template <class... Types> class A { public: - template <Types... Values> class X { /* ... */ }; // { dg-error "not a valid type for a template constant parameter" } + template <Types... Values> class X { /* ... */ }; // { dg-error "not a valid type for a template non-type parameter" } }; template<class... Types> class B diff --git a/gcc/testsuite/g++.dg/template/crash53.C b/gcc/testsuite/g++.dg/template/crash53.C index bbd1e7fc7ae..a8d7c1110bf 100644 --- a/gcc/testsuite/g++.dg/template/crash53.C +++ b/gcc/testsuite/g++.dg/template/crash53.C @@ -5,7 +5,7 @@ template<int> struct A {}; template<typename T> struct B { - template<T I> B(A<I>); // { dg-error "template constant parameter" } + template<T I> B(A<I>); // { dg-error "template non-type parameter" } }; B<double> a=A<0>(); // { dg-error "non-scalar type" } diff --git a/gcc/testsuite/g++.dg/template/void9.C b/gcc/testsuite/g++.dg/template/void9.C index bb2ed66ff38..319a684fa43 100644 --- a/gcc/testsuite/g++.dg/template/void9.C +++ b/gcc/testsuite/g++.dg/template/void9.C @@ -1,4 +1,4 @@ //PR c++/28738 template<int,void> struct A {}; // { dg-error "not a valid type" } -template<int N> struct A<N,0> {}; // { dg-error "not a valid type" } +template<int N> struct A<N,0> {}; // { dg-message "invalid" } |