Commit c454d74a by Jason Merrill Committed by Jason Merrill

re PR c++/48280 ([C++0x] ICE: tree check: expected var_decl or function_decl,…

re PR c++/48280 ([C++0x] ICE: tree check: expected var_decl or function_decl, have template_decl in check_bases_and_members, at cp/class.c:4695)

	PR c++/48280
	* method.c (defaultable_fn_check): Templates are not defaultable.

From-SVN: r171797
parent 4e36c213
2011-03-31 Jason Merrill <jason@redhat.com>
PR c++/48280
* method.c (defaultable_fn_check): Templates are not defaultable.
* parser.c (cp_parser_init_declarator): Avoid redundant
cp_finish_decl for member declarations.
......
......@@ -1588,6 +1588,12 @@ defaultable_fn_check (tree fn)
{
special_function_kind kind = sfk_none;
if (template_parm_scope_p ())
{
error ("a template cannot be defaulted");
return false;
}
if (DECL_CONSTRUCTOR_P (fn))
{
if (FUNCTION_FIRST_USER_PARMTYPE (fn) == void_list_node)
......
2011-03-31 Jason Merrill <jason@redhat.com>
* g++.dg/cpp0x/defaulted24.C: New.
2011-03-31 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
PR target/16292
......
// PR c++/48280
// { dg-options -std=c++0x }
struct S {
template < typename > S (const S &) = default; // { dg-error "" }
};
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