public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/56389] New: Return types differs in block scope function declarations and function implementation
@ 2013-02-19  8:58 forever14 at bk dot ru
  2013-02-19  9:15 ` [Bug c++/56389] " i.nixman at gmail dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: forever14 at bk dot ru @ 2013-02-19  8:58 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 56389
           Summary: Return types differs in block scope function
                    declarations and function implementation
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: forever14@bk.ru


Code:

int main()
{
   int f();
   f();
}

void f() { }

http://liveworkspace.org/code/1zsrDJ$3

>From C++ standard:

par 3.3.2/10 Function declarations at block scope and variable declarations
with the extern specifier at block scope refer to declarations that are members
of an enclosing namespace, but they do not introduce new names into that scope.

So, block scope function declaration is allowed, but why there is no diagnostic
on return types? In C such code cause error

http://liveworkspace.org/code/1zsrDJ$4


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

end of thread, other threads:[~2021-08-07 20:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-19  8:58 [Bug c++/56389] New: Return types differs in block scope function declarations and function implementation forever14 at bk dot ru
2013-02-19  9:15 ` [Bug c++/56389] " i.nixman at gmail dot com
2013-02-19  9:21 ` forever14 at bk dot ru
2020-12-24 16:13 ` gabravier at gmail dot com
2021-08-07 20:41 ` pinskia at gcc dot gnu.org
2021-08-07 20:43 ` pinskia 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).