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: [email protected]
ReportedBy: [email protected]
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.