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

            Bug ID: 67155
           Summary: Linking of complex constexpr static class member
                    failing across files
           Product: gcc
           Version: 5.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: JamesMikeDuPont at googlemail dot com
  Target Milestone: ---

Created attachment 36148
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36148&action=edit
test case

I encountered a strange behavior when creating a class that wraps a constexpr
string.

It seems that the static constant string field wrapped in a class is only
accessible in the same header file and not available in a separate compilation
unit. 

The workaround is to move the usage of the static fields into the header.

If you prefer git you can find the test case here as well :
https://github.com/h4ck3rm1k3/gcc-plugin-cpp-template/tree/constexpr/testcase

Reply via email to