[Bug c++/33520] New: Usage of extern inline functions violates C++ standard dcl 7.1.2 (4)
gcc at artemfrolov dot fastmail dot fm
gcc-bugzilla@gcc.gnu.org
Fri Sep 21 18:36:00 GMT 2007
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
More information about the Gcc-bugs
mailing list