This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/80485] rejects-valid: constexpr static_cast of pointer-to-member-function to bool
- From: "mpolacek at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 15 Jun 2018 16:50:37 +0000
- Subject: [Bug c++/80485] rejects-valid: constexpr static_cast of pointer-to-member-function to bool
- Auto-submitted: auto-generated
- References: <bug-80485-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80485
--- Comment #6 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
(In reply to Tony E Lewis from comment #5)
> Thanks to all for all work on this.
>
> (Apologies if this isn't helpful but just in case it is...) I notice that
> the original Godbolt snippet ( https://godbolt.org/g/JnrZss ) has regressed
> from a rejects-valid in 8.1 to an ICE on trunk ("9.0.0 20180610") :
I don't see that. This compiles fine with trunk:
struct dummy {
void nonnull() {};
};
typedef void (dummy::*safe_bool)();
constexpr safe_bool a = &dummy::nonnull;
static_assert( static_cast<bool>( a ), "" );
int main () { return 0; }