[Bug c++/66477] [constexpr] accepts-invalid with constexpr member call on non-constant reference
rs2740 at gmail dot com
gcc-bugzilla@gcc.gnu.org
Fri Mar 24 19:00:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66477
TC <rs2740 at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |rs2740 at gmail dot com
--- Comment #2 from TC <rs2740 at gmail dot com> ---
Seems to have something to do with reference-type parameters.
struct a { constexpr int size() const { return 3; } };
constexpr bool g(a&) { return true;}
void f(a &r) {
static_assert(r.size() == 3, "error"); // accepted
static_assert(g(r), ""); // likewise
a& rr = r;
static_assert(g(rr), ""); // rejected
static_assert(rr.size()==3, ""); // likewise
}
More information about the Gcc-bugs
mailing list