This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

C++ parser vs. attributes


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]