Bug 52371 - [C++11] ICE in noexcept with constexpr conversion function
Summary: [C++11] ICE in noexcept with constexpr conversion function
Status: RESOLVED DUPLICATE of bug 54207
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.7.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2012-02-24 13:53 UTC by Ai Azuma
Modified: 2013-06-10 15:46 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
Output of -v option and preprocessed file (1.22 KB, text/plain)
2012-02-24 13:54 UTC, Ai Azuma
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ai Azuma 2012-02-24 13:53:01 UTC
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.
Comment 1 Ai Azuma 2012-02-24 13:54:18 UTC
Created attachment 26741 [details]
Output of -v option and preprocessed file
Comment 2 Ai Azuma 2012-02-24 14:01:41 UTC
I'm sorry. I forgot to write that this ICE appears with -std=c++11 option.
Comment 3 Paolo Carlini 2013-06-10 15:46:33 UTC
Dup.

*** This bug has been marked as a duplicate of bug 54207 ***