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

* [Bug c++/56389] Return types differs in block scope function declarations and function implementation
  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 ` i.nixman at gmail dot com
  2013-02-19  9:21 ` forever14 at bk dot ru
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: i.nixman at gmail dot com @ 2013-02-19  9:15 UTC (permalink / raw)
  To: gcc-bugs


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

niXman <i.nixman at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |i.nixman at gmail dot com

--- Comment #1 from niXman <i.nixman at gmail dot com> 2013-02-19 09:15:12 UTC ---
(In reply to comment #0)

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

Please publish this history item.


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

* [Bug c++/56389] Return types differs in block scope function declarations and function implementation
  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
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: forever14 at bk dot ru @ 2013-02-19  9:21 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #2 from forever14 at bk dot ru 2013-02-19 09:20:11 UTC ---
niXman, published. Sorry.


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

* [Bug c++/56389] Return types differs in block scope function declarations and function implementation
  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
  4 siblings, 0 replies; 6+ messages in thread
From: gabravier at gmail dot com @ 2020-12-24 16:13 UTC (permalink / raw)
  To: gcc-bugs

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

Gabriel Ravier <gabravier at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |gabravier at gmail dot com

--- Comment #3 from Gabriel Ravier <gabravier at gmail dot com> ---
Seems to be fixed on trunk, though this still compiles on GCC 10 and before

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

* [Bug c++/56389] Return types differs in block scope function declarations and function implementation
  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
                   ` (2 preceding siblings ...)
  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
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-07 20:41 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |accepts-invalid

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Fixed for GCC 11.  I cannot figure out which patch fixed it though. 
There has been a bunch of fixes dealing with return types dealing with C++20
concepts.

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

* [Bug c++/56389] Return types differs in block scope function declarations and function implementation
  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
                   ` (3 preceding siblings ...)
  2021-08-07 20:41 ` pinskia at gcc dot gnu.org
@ 2021-08-07 20:43 ` pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-07 20:43 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #4)
> Fixed for GCC 11.  I cannot figure out which patch fixed it though. 
> There has been a bunch of fixes dealing with return types dealing with C++20
> concepts.

For an example PR 96443.

^ 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).