re PR c++/35331 (ICE with invalid specialization of variadic template)

/cp
2008-05-12  Paolo Carlini  <paolo.carlini@oracle.com>

        PR c++/35331
        * semantics.c (begin_class_definition): Extend checks on the first
	argument.

/testsuite
2008-05-12  Paolo Carlini  <paolo.carlini@oracle.com>

        PR c++/35331
        * g++.dg/cpp0x/vt-35331.C: New.	
	* g++.dg/cpp0x/pr32125.C: Adjust.
	* g++.dg/cpp0x/pr32126.C: Likewise.
	* g++.dg/cpp0x/pr31438.C: Likewise.
	* g++.dg/cpp0x/variadic81.C: Likewise.
	* g++.dg/cpp0x/vt-34055.C: Likewise.
	* g++.dg/cpp0x/vt-34606.C: Likewise.

From-SVN: r135216
This commit is contained in:
Paolo Carlini 2008-05-12 15:18:52 +00:00 committed by Paolo Carlini
parent 751d1520c3
commit 7d2f0ecd61
10 changed files with 40 additions and 16 deletions

View File

@ -1,3 +1,9 @@
2008-05-12 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/35331
* semantics.c (begin_class_definition): Extend checks on the first
argument.
2008-05-12 Tomas Bily <tbily@suse.cz>
* typeck2.c (digest_init): Use CONVERT_EXPR_P.

View File

@ -2223,7 +2223,7 @@ check_template_template_default_arg (tree argument)
tree
begin_class_definition (tree t, tree attributes)
{
if (t == error_mark_node)
if (error_operand_p (t) || error_operand_p (TYPE_MAIN_DECL (t)))
return error_mark_node;
if (processing_template_parmlist)

View File

@ -1,3 +1,14 @@
2008-05-12 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/35331
* g++.dg/cpp0x/vt-35331.C: New.
* g++.dg/cpp0x/pr32125.C: Adjust.
* g++.dg/cpp0x/pr32126.C: Likewise.
* g++.dg/cpp0x/pr31438.C: Likewise.
* g++.dg/cpp0x/variadic81.C: Likewise.
* g++.dg/cpp0x/vt-34055.C: Likewise.
* g++.dg/cpp0x/vt-34606.C: Likewise.
2008-05-12 Ira Rosen <irar@il.ibm.com>
* gfortran.dg/vect/pr36119.f: Rename to ...

View File

@ -2,8 +2,8 @@
template<typename> struct A;
template<typename T, typename... U> struct A<T(U)> // { dg-error "parameter packs|U" }
{ // { dg-error "parameter packs|U" }
template<typename X> A(X); // { dg-error "parameter packs|U" }
{
template<typename X> A(X);
};
A<void(int)> a(0); // { dg-error "incomplete type" }

View File

@ -2,7 +2,7 @@
template<typename...> struct A;
template<typename...T> struct A<T*> // { dg-error "not expanded|T" }
{ // { dg-error "not expanded|T" }
A(); // { dg-error "not expanded|T" }
A(T); // { dg-error "not expanded|T" }
{
A();
A(T);
};

View File

@ -2,7 +2,7 @@
template<typename...> struct A;
template<typename...T> struct A<T> // { dg-error "not expanded|T|" }
{ // { dg-error "not expanded|T|" }
{
static int i;
};

View File

@ -4,7 +4,7 @@
template<typename> struct A;
template<typename... T> struct A<T*> // { dg-error "not expanded|T|not used|T" }
{ // { dg-error "not expanded|T|not used|T" }
{
struct B;
};

View File

@ -3,8 +3,8 @@
template<typename...> struct A;
template<typename...T> struct A<T*> // { dg-error "parameter packs|T" }
{ // { dg-error "parameter packs|T" }
void foo(); // { dg-error "parameter packs|T|candidate" }
{
void foo();
};
template<typename...T> void A<T*>::foo() {} // { dg-error "invalid declarator" }
@ -14,8 +14,8 @@ template<typename...T> void A<T*>::foo() {} // { dg-error "invalid declarator" }
template<typename...> struct B;
template<typename...T> struct B<T&> // { dg-error "parameter packs|T" }
{ // { dg-error "parameter packs|T" }
void foo(); // { dg-error "parameter packs|T" }
{
void foo();
};
template<typename...T> void B<T&>::foo() {} // { dg-error "invalid declarator" }
@ -24,8 +24,8 @@ template<typename...T> void B<T&>::foo() {} // { dg-error "invalid declarator" }
template<typename...> struct C;
template<typename...T> struct C<T()> // { dg-error "parameter packs|T" }
{ // { dg-error "parameter packs|T" }
void foo(); // { dg-error "parameter packs|T" }
{
void foo();
};
template<typename...T> void C<T()>::foo() {} // { dg-error "invalid declarator" }

View File

@ -2,8 +2,8 @@
template<typename...> struct A;
template<typename T, typename... U> struct A<T, U> // { dg-error "parameter packs|U" }
{ // { dg-error "parameter packs|U" }
{
template<typename> struct B;
template<typename X> struct B<X*> {}; // { dg-error "parameter packs|U" }
template<typename X> struct B<X*> {};
};

View File

@ -0,0 +1,7 @@
// { dg-options "-std=c++0x" }
template<typename...> struct A;
template<typename...T> struct A<T*> // { dg-error "not expanded|T" }
{
friend void foo();
};