[Bug c++/27739] New: "expected primary-expression before double" error caused by simple varaible name

bugzilla at adamauton dot com gcc-bugzilla@gcc.gnu.org
Tue May 23 08:43:00 GMT 2006


Hello,
    I have tried to compile the following simple code using g++ version 3.4.4.

int main(int argc, char *argv[])
{
        double or;
        return 1;
}

The compiler returns the following errors:

main.cpp: In function `int main(int, char**)':
main.cpp:3: error: expected primary-expression before "double"
main.cpp:3: error: expected `;' before "double"
make: *** [dummy] Error 1


Renaming the variable something other than 'or' fixes the error. Nevertheless,
the error message isn't particularly clear!

Many thanks


-- 
           Summary: "expected primary-expression before double" error caused
                    by simple varaible name
           Product: gcc
           Version: 3.4.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bugzilla at adamauton dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27739



More information about the Gcc-bugs mailing list