Commit bf98d3b6 by Paolo Carlini Committed by Paolo Carlini

re PR c++/31446 (ICE with invalid template parameter)

/cp
2007-10-16  Paolo Carlini  <pcarlini@suse.de>

	PR c++/31446
	* pt.c (current_template_args): Do not change TREE_LIST elements
	with a TREE_VALUE of error_mark_node.

/testsuite
2007-10-16  Paolo Carlini  <pcarlini@suse.de>

	PR c++/31446
	* g++.dg/template/void11.C: New.
	* g++.dg/template/void2.C: Adjust error markers.
	* g++.dg/template/void10.C: Likewise.
	* g++.dg/template/crash55.C: Likewise.

From-SVN: r129391
parent 7aa1cb97
2007-10-16 Paolo Carlini <pcarlini@suse.de>
PR c++/31446
* pt.c (current_template_args): Do not change TREE_LIST elements
with a TREE_VALUE of error_mark_node.
2007-10-16 Mark Mitchell <mark@codesourcery.com> 2007-10-16 Mark Mitchell <mark@codesourcery.com>
* typeck.c (cp_apply_type_quals_to_decl): Expand documentation. * typeck.c (cp_apply_type_quals_to_decl): Expand documentation.
......
...@@ -3136,8 +3136,8 @@ current_template_args (void) ...@@ -3136,8 +3136,8 @@ current_template_args (void)
TREE_TYPE (t) = type; TREE_TYPE (t) = type;
} }
} }
TREE_VEC_ELT (a, i) = t;
} }
TREE_VEC_ELT (a, i) = t;
} }
} }
......
2007-10-16 Paolo Carlini <pcarlini@suse.de>
PR c++/31446
* g++.dg/template/void11.C: New.
* g++.dg/template/void2.C: Adjust error markers.
* g++.dg/template/void10.C: Likewise.
* g++.dg/template/crash55.C: Likewise.
2007-10-16 Mark Mitchell <mark@codesourcery.com> 2007-10-16 Mark Mitchell <mark@codesourcery.com>
* g++.dg/opt/const5.C: New test. * g++.dg/opt/const5.C: New test.
//PR c++/27668 //PR c++/27668
template<typename class T, T = T()> // { dg-error "nested-name-specifier|two or more|valid type" } template<typename class T, T = T()> // { dg-error "nested-name-specifier|two or more|valid type" }
struct A {}; // { dg-error "definition|template" } struct A {};
template<int> void foo(A<int>); // { dg-error "mismatch|constant|template argument" } template<int> void foo(A<int>); // { dg-error "mismatch|constant|template argument" }
...@@ -7,4 +7,4 @@ template<void> struct A // { dg-error "not a valid type" } ...@@ -7,4 +7,4 @@ template<void> struct A // { dg-error "not a valid type" }
template<typename> struct B {}; template<typename> struct B {};
B<int> b; // { dg-error "template argument|invalid type" } B<int> b;
// PR c++/31446
template<void> struct A // { dg-error "valid type" }
{
template<int> friend void foo();
};
void bar()
{
foo<0>(); // { dg-error "not declared|primary-expression" }
}
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
template<int> struct A template<int> struct A
{ {
template<void> friend class X; // { dg-error "void" } template<void> friend class X; // { dg-error "void|valid type" }
}; };
A<0> a; A<0> a;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment