This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/53930] bug in linker
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 12 Jul 2012 10:09:10 +0000
- Subject: [Bug c++/53930] bug in linker
- Auto-submitted: auto-generated
- References: <bug-53930-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53930
--- Comment #7 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-07-12 10:09:10 UTC ---
ISO 14882:2011 3.2
"There can be more than one definition of a class type (Clause 9), [...] in a
program provided that each definition appears in a different translation unit,
and provided the definitions satisfy the following requirements. Given
such an entity named D defined in more than one translation unit, then
â each definition of D shall consist of the same sequence of tokens; [...]"
So you can have A defined in two different files, but it must be defined
identically, because it refers to the same class.