[Bug c++/70095] [C++14] Link error on partially specialized variable template

jason at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Jul 18 16:14:00 GMT 2016


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70095

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|---                         |6.0

--- Comment #4 from Jason Merrill <jason at gcc dot gnu.org> ---
(In reply to Tom Honermann from comment #2)
> The change in comment 1 introduced a regression.  The following test passes
> with r234230, but fails with r234231:
> 
> $ cat t.cpp
> template <class>
> constexpr bool b = false;
> template<typename T>
> constexpr bool b<T*> = true;
> int main() {
>     b<int*>;
>     b<double*>;
> }
> 
> $ g++ -std=c++14 t.cpp -o t
> /tmp/ccJTAQId.s: Assembler messages:
> /tmp/ccJTAQId.s:27: Error: symbol `_ZL1b' is already defined

I think this was fixed by the patch for 69515.  In any case, it works now.


More information about the Gcc-bugs mailing list