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++/80485] rejects-valid: constexpr static_cast of pointer-to-member-function to bool


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; }

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