This is the mail archive of the gcc-bugs@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]
Other format: [Raw text]

[Bug c++/51186] New: declaring main() with auto but without --std=c++11 gives inconsistent error messages


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

             Bug #: 51186
           Summary: declaring main() with auto but without --std=c++11
                    gives inconsistent error messages
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: wswiktor@poczta.fm


When I try to compile this code without specifying C++11 or C++0x standard

    auto main()->int
    {
    }

the following conflicting messages are generated:

    cpp.cpp:1:14: error: top-level declaration of 'main' specifies 'auto'
    cpp.cpp:1:14: error: 'main' function with late return type not declared
with 'auto' type specifier

The second one should be disabled when not in C++11 mode, or replaced with one
saying that funtions with late return type are not allowed.


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