On Tue, 1 Oct 2019 at 10:42, Michael Price - Dev via cfe-users <
cfe-users@lists.llvm.org> wrote:

> Should this be ill-formed?
>
> struct C {
>   constexpr C() {}
>   constexpr bool f() const { return true; }
> };
> constexpr C c{};
>
> constexpr bool fails_9_0_0(const C* pc, bool (C::*pm)() const) {
>   return (pc->*pm)();
> }
> constexpr bool b = fails_9_0_0(&c, &C::f);
>
>
> Clang 9 produces a diagnostic stating “constexpr function never produces a
> constant expression” for `fails_9_0_0`. Works in Clang 8 as well as GCC and
> MSVC.
>

This was also filed as PR43519 and is now fixed in trunk.


> — Michael Price
>
> Sent from my iPhone
> _______________________________________________
> cfe-users mailing list
> cfe-users@lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users
>
_______________________________________________
cfe-users mailing list
cfe-users@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users

Reply via email to