[Bug c++/59686] Non-constexpr pointers accepted in constant expressions
ville.voutilainen at gmail dot com
gcc-bugzilla@gcc.gnu.org
Sun Jan 5 17:19:00 GMT 2014
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59686
--- Comment #1 from Ville Voutilainen <ville.voutilainen at gmail dot com> ---
(In reply to Ville Voutilainen from comment #0)
> int main
> {
> static const int x = 5;
> const int * const y = &x;
> static_assert(y, "");
> }
>
> clang rejects this, gcc accepts.
well, typo, should be int main(), of course... in other words,
int main()
{
static const int x = 5;
const int * const y = &x;
static_assert(y, "");
}
More information about the Gcc-bugs
mailing list