This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/33520] New: Usage of extern inline functions violates C++ standard dcl 7.1.2 (4)
- From: "gcc at artemfrolov dot fastmail dot fm" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Sep 2007 18:35:58 -0000
- Subject: [Bug c++/33520] New: Usage of extern inline functions violates C++ standard dcl 7.1.2 (4)
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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