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++/33520] New: Usage of extern inline functions violates C++ standard dcl 7.1.2 (4)


According to C++ standard 7.1.2 (4):
An inline function shall be defined in every translation unit in which
it  is  used  and shall have exactly the same definition in every case

For the following code:
---------
inline.cc
---------
#include <stdio.h>

inline void foo() {
    printf("Hey!\n");
}

void bar() {
    foo();
}
----------
main.cc
----------
extern void foo();
int main() {
    foo();
    return 0;
}
----------

g++ -std=c++98 main.cc inline.cc

creates a program and does not report any violation of the standard.


-- 
           Summary: Usage of extern inline functions violates C++ standard
                    dcl 7.1.2 (4)
           Product: gcc
           Version: 4.1.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: gcc at artemfrolov dot fastmail dot fm


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


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