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

            Bug ID: 68012
           Summary: g++ incorrectly accepts forward declaration of
                    constexpt variable template
           Product: gcc
           Version: 5.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: morwenn29 at hotmail dot fr
  Target Milestone: ---

I had the following piece of code in one of my projects:

    template<typename>
    constexpr std::size_t iterator_category_value;

g++5.2 is happy with it but clang is not and complains, saying that it
shouldn't be possible to forward-declare a constexpr whatever. To be sure, I
asked the question on StackOverflow:
http://stackoverflow.com/q/33197817/1364752

It seems that this code should not be accepted, and a defect report seems to
agree that it should be rejected: http://wg21.cmeerw.net/cwg/issue1712

Reply via email to