[Bug c++/57471] New: [C++11] Bizarre error for template parameter pack

ai.azuma at gmail dot com gcc-bugzilla@gcc.gnu.org
Thu May 30 12:34:00 GMT 2013


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57471

            Bug ID: 57471
           Summary: [C++11] Bizarre error for template parameter pack
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ai.azuma at gmail dot com

Created attachment 30226
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30226&action=edit
Output of -v option and preprocessed source

GCC 4.9.0 20130526 rejects the following valid code.

//-----------------------------------------
struct A
{
  static constexpr bool value = true;
};

template<typename... Types>
struct B
{
  static_assert(A::value, "");
  static_assert(sizeof...(Types) == 0, "");
};
//-----------------------------------------

The error message is;

main.cpp:10:27: error: 'A::Types' has not been declared
   static_assert(sizeof...(Types) == 0, "");
                           ^

The above code successfully compiles with 4.7.4 20130525 and 4.8.1 20130523.



More information about the Gcc-bugs mailing list