public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/66995] New: First declaration as inline after definition of function
@ 2015-07-24 14:12 anders.granlund.0 at gmail dot com
  2015-07-24 15:25 ` [Bug c++/66995] " redi at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: anders.granlund.0 at gmail dot com @ 2015-07-24 14:12 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 66995
           Summary: First declaration as inline after definition of
                    function
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: anders.granlund.0 at gmail dot com
  Target Milestone: ---

Consider the following program (prog.cc):

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

It is ill-formed by [dcl.fct.spec]/4 (http://eel.is/c++draft/dcl.fct.spec#4):

"If the definition of a function appears in a translation unit before its first
declaration as inline, the program is ill-formed."

Therefore I expected gcc to give at least one diagnostic message when compiling
it, but I get none with the following command line:

  g++ prog.cc -std=c++98 -pedantic-errors

I have tried with gcc HEAD 6.0.0 20150722 here:

  http://melpon.org/wandbox/permlink/c6wrML22huCFZMxp


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

end of thread, other threads:[~2022-08-24 12:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-24 14:12 [Bug c++/66995] New: First declaration as inline after definition of function anders.granlund.0 at gmail dot com
2015-07-24 15:25 ` [Bug c++/66995] " redi at gcc dot gnu.org
2021-08-27  0:49 ` [Bug c++/66995] [DR317] " pinskia at gcc dot gnu.org
2022-08-24 11:52 ` redi at gcc dot gnu.org
2022-08-24 11:52 ` redi at gcc dot gnu.org
2022-08-24 11:54 ` redi at gcc dot gnu.org
2022-08-24 12:46 ` whh8b at obs dot cr

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