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++/52282] [C++0x] ICE / confused by earlier errors with decltype/constexpr


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

--- Comment #4 from Daniel KrÃgler <daniel.kruegler at googlemail dot com> 2012-05-04 16:42:39 UTC ---
(In reply to comment #3)
> This ICE still occurs in the release version of gcc 4.7.0.

And also in 4.8.0 HEAD btw.

> The attached test-case compiles and runs successfully under clang with one
> small change as shown in this diff (this doesn't affect the test-case under
> gcc):
> 
> --- ice.cpp
> +++ ice.cpp
> @@ -53,6 +53,7 @@
>  static_assert(Z_<int(*)(), &b<10>>::value() == 10, "oops");    // ICE
> 
>  constexpr struct C {
> +    constexpr C() = default;
>      constexpr int c1() const { return 10; }
>      static constexpr int c2() { return 10; }
>  } c;

These changes are necessary for any reasonable comparison.

It seems to me that we have at least two compiler bugs here. 

1) The ICE
2) The incorrect diagnostics of some non-constexpr function.

The latter error reminds me very much of bug 52892 where it became clear that
gcc can loose constexpr information when typedefs and template parameters are
inserted.


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