c++/3600: g++ 2.95.3 complains about "unsigned long( 25 )"

lerdsuwa@gcc.gnu.org lerdsuwa@gcc.gnu.org
Sat Jul 7 06:42:00 GMT 2001


Synopsis: g++ 2.95.3 complains about "unsigned long( 25 )"

State-Changed-From-To: open->closed
State-Changed-By: lerdsuwa
State-Changed-When: Sat Jul  7 06:42:22 2001
State-Changed-Why:
    Not a bug.  According to the standard, section 5.2.3 Explicit
    type conversion (functional notation) paragraph 1:
      A simple-type-specifier (7.1.5) followed by a parenthesized
      expression-list constructs a value of the specified type
      given the expression list.  If the expression list is a
      single expression, the type conversion expression is
      equivalent (in definedness, and if defined in meaning)
      to the corresponding cast expression (5.4). ...
    
    And in 7.1.5.2 Simple type specifiers, para 1
      The simple type specifiers are
        simple-type-specifier:
          unsigned
          long
          <other valid tokens snipped>
    
    So only "unsigned(25)" or "long(25)" is allowed.  
    "unsigned long(25)" contains two simple-type-specifier's
    and therefore is forbid by the 5.2.3 para 1 of the standard.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=3600&database=gcc



More information about the Gcc-bugs mailing list