diff options
| author | Jason Merrill <jason@redhat.com> | 2011-03-31 16:29:49 -0400 |
|---|---|---|
| committer | Jason Merrill <jason@gcc.gnu.org> | 2011-03-31 16:29:49 -0400 |
| commit | c454d74afcf58585beddb8d300f77d615d65330c (patch) | |
| tree | 9dd79a48dc3f7fecf3b4b267e73084419d3d3637 /gcc/cp/method.c | |
| parent | 4e36c2131fcffc92881baa8dca67c868574bfacb (diff) | |
| download | gcc-c454d74afcf58585beddb8d300f77d615d65330c.zip gcc-c454d74afcf58585beddb8d300f77d615d65330c.tar.gz gcc-c454d74afcf58585beddb8d300f77d615d65330c.tar.bz2 | |
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
Diffstat (limited to 'gcc/cp/method.c')
| -rw-r--r-- | gcc/cp/method.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/cp/method.c b/gcc/cp/method.c index 386a818..b741516 100644 --- a/gcc/cp/method.c +++ b/gcc/cp/method.c @@ -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) |
