Commit 455d833c by Marek Polacek Committed by Marek Polacek

re PR c++/79967 (ICE on non-type template argument declared noreturn)

	PR c++/79967
	* decl.c (grokdeclarator): Check ATTRLIST before dereferencing it.

	* g++.dg/cpp0x/gen-attrs-63.C: New test.

From-SVN: r246039
parent e260b0a7
2017-03-10 Marek Polacek <polacek@redhat.com>
PR c++/79967
* decl.c (grokdeclarator): Check ATTRLIST before dereferencing it.
2017-03-10 Jakub Jelinek <jakub@redhat.com> 2017-03-10 Jakub Jelinek <jakub@redhat.com>
PR c++/79899 PR c++/79899
......
...@@ -11402,7 +11402,8 @@ grokdeclarator (const cp_declarator *declarator, ...@@ -11402,7 +11402,8 @@ grokdeclarator (const cp_declarator *declarator,
if (declarator if (declarator
&& declarator->kind == cdk_id && declarator->kind == cdk_id
&& declarator->std_attributes) && declarator->std_attributes
&& attrlist != NULL)
/* [dcl.meaning]/1: The optional attribute-specifier-seq following /* [dcl.meaning]/1: The optional attribute-specifier-seq following
a declarator-id appertains to the entity that is declared. */ a declarator-id appertains to the entity that is declared. */
*attrlist = chainon (*attrlist, declarator->std_attributes); *attrlist = chainon (*attrlist, declarator->std_attributes);
......
2017-03-10 Marek Polacek <polacek@redhat.com>
PR c++/79967
* g++.dg/cpp0x/gen-attrs-63.C: New test.
2017-03-10 Jakub Jelinek <jakub@redhat.com> 2017-03-10 Jakub Jelinek <jakub@redhat.com>
PR c++/79899 PR c++/79899
......
// PR c++/79967
// { dg-do compile { target c++11 } }
template <void f [[noreturn]]()>
struct A
{
int g () { f (); return 0; }
};
void f ();
void g (A<f> a) { a.g (); }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment