This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/52371] New: [C++11] ICE in noexcept with constexpr conversion function


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

             Bug #: 52371
           Summary: [C++11] ICE in noexcept with constexpr conversion
                    function
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: ai.azuma@gmail.com


The following well-formed code causes ICE on GCC 4.7.0 20120218 (experimental).

//////////////////////////////////////////////////////////////
template<typename T, T v>
struct integral_constant
{
  typedef T value_type;
  static constexpr value_type value = v;
  constexpr operator value_type() { return value; }
};

template<typename T>
struct B
{
  B()
  noexcept(integral_constant<bool, noexcept(T())>()) // <- ICE
    : v_()
  {}

  T v_;
};

int main()
{
  B<int> b;
}
//////////////////////////////////////////////////////////////

If I use the static constexpr `value' instread of the constexpr conversion
function, the ICE disappears.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]