mirror of git://gcc.gnu.org/git/gcc.git
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
This commit is contained in:
parent
4e36c2131f
commit
c454d74afc
|
|
@ -1,5 +1,8 @@
|
||||||
2011-03-31 Jason Merrill <jason@redhat.com>
|
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
|
* parser.c (cp_parser_init_declarator): Avoid redundant
|
||||||
cp_finish_decl for member declarations.
|
cp_finish_decl for member declarations.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1588,6 +1588,12 @@ defaultable_fn_check (tree fn)
|
||||||
{
|
{
|
||||||
special_function_kind kind = sfk_none;
|
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 (DECL_CONSTRUCTOR_P (fn))
|
||||||
{
|
{
|
||||||
if (FUNCTION_FIRST_USER_PARMTYPE (fn) == void_list_node)
|
if (FUNCTION_FIRST_USER_PARMTYPE (fn) == void_list_node)
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,7 @@
|
||||||
|
2011-03-31 Jason Merrill <jason@redhat.com>
|
||||||
|
|
||||||
|
* g++.dg/cpp0x/defaulted24.C: New.
|
||||||
|
|
||||||
2011-03-31 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
|
2011-03-31 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
|
||||||
|
|
||||||
PR target/16292
|
PR target/16292
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
// PR c++/48280
|
||||||
|
// { dg-options -std=c++0x }
|
||||||
|
|
||||||
|
struct S {
|
||||||
|
template < typename > S (const S &) = default; // { dg-error "" }
|
||||||
|
};
|
||||||
Loading…
Reference in New Issue