[Bug c++/102012] GCC accepts any non-bool atomic constraint type

hewillk at gmail dot com gcc-bugzilla@gcc.gnu.org
Mon Aug 23 14:39:36 GMT 2021


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102012

--- Comment #2 from 康桓瑋 <hewillk at gmail dot com> ---
(In reply to Patrick Palka from comment #1)
> Hmm, I think this might actually be well-formed according to [temp.names]/9.
> I don't see why we'd need to check satisfaction of a concept-id inside
> decltype if its type is already prescribed to be bool.

You are right..

template<class T>
concept C = T{}.foo();

decltype(C<int>) x = 0;

https://godbolt.org/z/zr5qhfGPY


More information about the Gcc-bugs mailing list