[C++ Patch] PR 29731

Paolo Carlini pcarlini@suse.de
Wed Sep 5 09:19:00 GMT 2007


Hi Mark,

>Paolo Carlini wrote:
>
>>/cp
>>2007-09-03  Paolo Carlini  <pcarlini@suse.de>
>>
>>	PR c++/29731 (again)
>>	* parser.c (cp_parser_primary_expression): Return error_mark_node
>>	when a statement-expression is found in a template-argument list.
>>
>>/testsuite
>>2007-09-03  Paolo Carlini  <pcarlini@suse.de>
>>
>>	PR c++/29731
>>	* g++.dg/parse/template24.C: New.
>>    
>>
>This is OK.
>  
>
Ok, thanks.

>What does your patch do about things like:
>
>  X<sizeof ({ int i; i; })>
>
>It's fine by me to reject that.  (Anybody want to try to mangle *that*?)
> But, I'm curious because, in theory, it's a sensible thing to do.
>
It rejects it, with the same error message of the other two testcases 
for 29731. The unpatched compiler also rejects it (no internal error) with:

29731_3.C: In function 'void foo()':
29731_3.C:5: error: expected `::' before 'a'
29731_3.C:5: error: 'A::a' has not been declared

Paolo.



More information about the Gcc-patches mailing list