diff options
author | Jakub Jelinek <jakub@redhat.com> | 2016-12-02 22:23:22 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2016-12-02 22:23:22 +0100 |
commit | a3f7c896a55c33e369f9bbb210f4b43a345beabe (patch) | |
tree | 8c04b12d045e1a25891550c03c4dab0edcb8e91b /gcc | |
parent | 81cff75ff9178e9344e1f4c8935ffd451f66632f (diff) | |
download | gcc-a3f7c896a55c33e369f9bbb210f4b43a345beabe.zip gcc-a3f7c896a55c33e369f9bbb210f4b43a345beabe.tar.gz gcc-a3f7c896a55c33e369f9bbb210f4b43a345beabe.tar.bz2 |
re PR c++/78649 (ICE on invalid C++ code on x86_64-linux-gnu (internal compiler error: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in build_value_init_noctor, at cp/init.c:380))
PR c++/78649
* pt.c (tsubst_init): Don't call build_value_init if decl's type
is error_mark_node.
* g++.dg/cpp0x/pr78649.C: New test.
From-SVN: r243204
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/pt.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/pr78649.C | 16 |
4 files changed, 28 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index d39c222..f16813d 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2016-12-02 Jakub Jelinek <jakub@redhat.com> + + PR c++/78649 + * pt.c (tsubst_init): Don't call build_value_init if decl's type + is error_mark_node. + 2016-12-02 Cesar Philippidis <cesar@codesourcery.com> James Norris <jnorris@codesourcery.com> diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 8b0a21c..b51e580 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -14082,7 +14082,7 @@ tsubst_init (tree init, tree decl, tree args, init = tsubst_expr (init, args, complain, in_decl, false); - if (!init) + if (!init && TREE_TYPE (decl) != error_mark_node) { /* If we had an initializer but it instantiated to nothing, diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 261731c..103906b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-12-02 Jakub Jelinek <jakub@redhat.com> + + PR c++/78649 + * g++.dg/cpp0x/pr78649.C: New test. + 2016-12-02 Uros Bizjak <ubizjak@gmail.com> PR target/70322 diff --git a/gcc/testsuite/g++.dg/cpp0x/pr78649.C b/gcc/testsuite/g++.dg/cpp0x/pr78649.C new file mode 100644 index 0000000..43bcb64 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/pr78649.C @@ -0,0 +1,16 @@ +// PR c++/78649 +// { dg-do compile { target c++11 } } + +template <class> void foo (); +template <class T, class... U> +void +test () +{ + T t (foo<U>...); // { dg-error "declared void" } +} + +int +main () +{ + test<void> (); +} |