[Bug c++/115772] [14/15 Regression] static_assert incorrectly accept constexpr member function with non-constexpr this
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Jul 3 14:23:34 GMT 2024
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115772
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to work| |13.2.0
Known to fail| |14.1.0
Keywords|needs-bisection |
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Without the library header:
template<int Capa>
class Ttest
{
public:
constexpr int cap() const;
};
template<int Capa>
inline constexpr int Ttest<Capa>::cap() const
{
return Capa;
}
void test(const Ttest<30>& pa)
{
static_assert(pa.cap() < 60,"assert triggered");
}
int main()
{
Ttest<30> m_a;
test(m_a);
}
Started to be accepted with r14-5979
c++: P2280R4, Using unknown refs in constant expr [PR106650]
More information about the Gcc-bugs
mailing list