[Bug c++/93585] Linker resolves variable with extern variable of same name but different type
normvcr at telus dot net
gcc-bugzilla@gcc.gnu.org
Wed Feb 5 16:17:00 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93585
--- Comment #3 from Norman Goldstein <normvcr at telus dot net> ---
The 2nd reference
https://en.cppreference.com/w/cpp/language/definition
differentiates between a bare "extern" statement, and an initializing extern
statement. The former is a declaration, but not a definition. So, the ODR is
not violated. The linker would only need to verify that the types are the
same.
More information about the Gcc-bugs
mailing list