[C++ Patch] PR 84636 ("internal compiler error: Segmentation fault (identifier_p()/grokdeclarator())")

Jason Merrill jason@redhat.com
Sun Dec 2 04:26:00 GMT 2018


On 11/21/18 7:03 PM, Paolo Carlini wrote:
> ... in fact I'm thinking that the below - which directly checks for 
> unqualified_id to be non-null in both places - may be a better variant: 
> among other things it means that for related testcases like:
> typedef void a();
> struct A
> { a a1: 1; };
> we get the location of a1 right (we could also change the diagnostics in 
> grokbitfield to use DECL_SOURCE_LOCATION and exploit it), and the 
> testsuite doesn't need adjustments. Tested x86_64-linux.

> -	else if (TREE_CODE (type) == FUNCTION_TYPE
> -		 || TREE_CODE (type) == METHOD_TYPE)
> +	else if (FUNC_OR_METHOD_TYPE_P (type) && unqualified_id)

Maybe change this to

else if (funcdecl_p)

?

OK either way.

Jason



More information about the Gcc-patches mailing list