[Bug c++/67185] [C++14] Link error on ODR-use of variable template partial specialization
Casey at Carter dot net
gcc-bugzilla@gcc.gnu.org
Sun Mar 6 14:02:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67185
Casey Carter <Casey at Carter dot net> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |Casey at Carter dot net
Version|6.0 |5.3.0
Blocks|67491 |
Summary|[concepts] Link error on |[C++14] Link error on
|ODR-use of constexpr |ODR-use of variable
|constrained variable |template partial
|template partial |specialization
|specialization |
--- Comment #1 from Casey Carter <Casey at Carter dot net> ---
This same bug is triggered by the purely C++14 program:
template <class>
bool x = false;
template <class T>
bool x<T*> = true;
bool& f() { return x<int*>; }
int main() {}
which when compiled with either g++ 5.3 or 6 results in
/tmp/ccHHu1ip.o: In function `f()':
prog.cc:(.text+0x5): undefined reference to `x'
collect2: error: ld returned 1 exit status
The problem has nothing to do with concepts or constexpr, but seems to be a
general issue when ODR-using an instance of a template variable that was
instantiated from a partial specialization. I'm recasting this as a C++14 bug
against 5.3.
Referenced Bugs:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67491
[Bug 67491] [meta-bug] concepts issues
More information about the Gcc-bugs
mailing list