diff options
author | Jason Merrill <jason@redhat.com> | 2018-04-06 11:12:34 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2018-04-06 11:12:34 -0400 |
commit | a82f886aa67b81ef2c8499b698c2803f262bb582 (patch) | |
tree | ab4e45d7fdb484fee55acad67b59576a299098f9 /gcc | |
parent | 0c923157ab1522e9d8b2fe8c3dabc6c5cbc35b1d (diff) | |
download | gcc-a82f886aa67b81ef2c8499b698c2803f262bb582.zip gcc-a82f886aa67b81ef2c8499b698c2803f262bb582.tar.gz gcc-a82f886aa67b81ef2c8499b698c2803f262bb582.tar.bz2 |
PR c++/85242 - ICE with class definition in template parm.
* cp-tree.h (PROCESSING_REAL_TEMPLATE_DECL_P): False if
processing_template_parmlist.
From-SVN: r259178
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/cp/cp-tree.h | 3 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/template/error58.C | 8 |
3 files changed, 14 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 71eceaa..71a5d45 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,9 @@ 2018-04-06 Jason Merrill <jason@redhat.com> + PR c++/85242 - ICE with class definition in template parm. + * cp-tree.h (PROCESSING_REAL_TEMPLATE_DECL_P): False if + processing_template_parmlist. + PR c++/85240 - LTO ICE with using of undeduced auto fn. * cp-gimplify.c (cp_genericize_r): Discard using of undeduced auto. diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index dbe34c0..204791e 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -4719,7 +4719,8 @@ more_aggr_init_expr_args_p (const aggr_init_expr_arg_iterator *iter) entity with its own template parameter list, and which is not a full specialization. */ #define PROCESSING_REAL_TEMPLATE_DECL_P() \ - (processing_template_decl > template_class_depth (current_scope ())) + (!processing_template_parmlist \ + && processing_template_decl > template_class_depth (current_scope ())) /* Nonzero if this VAR_DECL or FUNCTION_DECL has already been instantiated, i.e. its definition has been generated from the diff --git a/gcc/testsuite/g++.dg/template/error58.C b/gcc/testsuite/g++.dg/template/error58.C new file mode 100644 index 0000000..cede1c9 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/error58.C @@ -0,0 +1,8 @@ +// PR c++/85242 + +namespace N +{ + struct A {}; +} + +template<struct N::A {}> void foo(); // { dg-error "" } |