This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/52371] New: [C++11] ICE in noexcept with constexpr conversion function
- From: "ai.azuma at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 24 Feb 2012 13:53:01 +0000
- Subject: [Bug c++/52371] New: [C++11] ICE in noexcept with constexpr conversion function
- Auto-submitted: auto-generated
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.