This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
C++ parser vs. attributes
- To: gcc at gcc dot gnu dot org
- Subject: C++ parser vs. attributes
- From: Mark Mitchell <mark at codesourcery dot com>
- Date: Fri, 20 Jul 2001 17:59:35 -0700
- cc: jason at redhat dot com
The old parser accepts:
struct S { S(int); };
S s (3) __attribute__ (...);
As far as I can tell, this is accident. It thinks `s(3)' is a
declarator (!) because the limitations of YACC force us to do all
this pseudo-parsing and then reparsing stuff.
The right way to write this code is:
S s __attribute__ (...) (3);
The grammar is *supposed* to be:
declarator asm-specification [opt] attributes [opt] initializer
How important is it that the new parser support this rather ungainly,
and undocumented, alleged feature?
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com