diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2019-04-26 14:51:00 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2019-04-26 14:51:00 +0000 |
commit | 69dad6faf9f00b0b22a822f0a0bcc57e7256959e (patch) | |
tree | fe00bddb7e0392b48519e3c593c7bc0ee27b2b18 | |
parent | 8281e3b8ea4fe692c92c8781636a36e81f4e038f (diff) | |
download | gcc-69dad6faf9f00b0b22a822f0a0bcc57e7256959e.zip gcc-69dad6faf9f00b0b22a822f0a0bcc57e7256959e.tar.gz gcc-69dad6faf9f00b0b22a822f0a0bcc57e7256959e.tar.bz2 |
re PR c++/90173 (ICE: Segmentation fault (in strip_declarator_types))
/cp
2019-04-26 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/90173
* decl.c (grokdeclarator): Set type to error_mark_node
upon error about template placeholder type non followed
by a simple declarator-id.
/testsuite
2019-04-26 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/90173
* g++.dg/cpp1z/class-deduction66.C: New.
From-SVN: r270603
-rw-r--r-- | gcc/cp/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/cp/decl.c | 1 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp1z/class-deduction66.C | 10 |
4 files changed, 25 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index c78683d..ab25cb9 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,4 +1,11 @@ -2018-04-26 Paolo Carlini <paolo.carlini@oracle.com> +2019-04-26 Paolo Carlini <paolo.carlini@oracle.com> + + PR c++/90173 + * decl.c (grokdeclarator): Set type to error_mark_node + upon error about template placeholder type non followed + by a simple declarator-id. + +2019-04-26 Paolo Carlini <paolo.carlini@oracle.com> * decl.c (grokdeclarator): Fix value assigned to typespec_loc, use min_location. diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 49ab387..ca21cbb 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -10973,6 +10973,7 @@ grokdeclarator (const cp_declarator *declarator, error_at (typespec_loc, "template placeholder type %qT must be followed " "by a simple declarator-id", type); inform (DECL_SOURCE_LOCATION (tmpl), "%qD declared here", tmpl); + type = error_mark_node; } staticp = 0; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 13416da..2ada826 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,4 +1,9 @@ -2018-04-26 Paolo Carlini <paolo.carlini@oracle.com> +2019-04-26 Paolo Carlini <paolo.carlini@oracle.com> + + PR c++/90173 + * g++.dg/cpp1z/class-deduction66.C: New. + +2019-04-26 Paolo Carlini <paolo.carlini@oracle.com> * g++.dg/diagnostic/trailing1.C: New. diff --git a/gcc/testsuite/g++.dg/cpp1z/class-deduction66.C b/gcc/testsuite/g++.dg/cpp1z/class-deduction66.C new file mode 100644 index 0000000..7ed119d --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1z/class-deduction66.C @@ -0,0 +1,10 @@ +// PR c++/90173 +// { dg-do run { target c++17 } } + +template <typename T> struct A { }; + +A(int) -> A<int>; + +namespace decl { + A (*fp)() = 0; // { dg-error "placeholder" } +} |