public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/51186] New: declaring main() with auto but without --std=c++11 gives inconsistent error messages
@ 2011-11-17  9:01 wswiktor at poczta dot fm
  2011-11-17 21:08 ` [Bug c++/51186] " jason at gcc dot gnu.org
  2011-11-17 21:08 ` jason at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: wswiktor at poczta dot fm @ 2011-11-17  9:01 UTC (permalink / raw)
  To: gcc-bugs

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.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-11-17 21:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-17  9:01 [Bug c++/51186] New: declaring main() with auto but without --std=c++11 gives inconsistent error messages wswiktor at poczta dot fm
2011-11-17 21:08 ` [Bug c++/51186] " jason at gcc dot gnu.org
2011-11-17 21:08 ` jason at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).