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

Daniel Krügler <daniel.kruegler at googlemail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |daniel.kruegler@googlemail.
                   |                            |com

--- Comment #3 from Daniel Krügler <daniel.kruegler at googlemail dot com> ---
> What is the reason why it compiled on C++98?
> I expect that it is incorrect
> syntax for C++98 and code doesn't match language grammatics. So expected
> behavior is "compilation error".

There is no requirement for your expected behaviour. The standard only requires
a diagnostics in such a case, see [intro.compliance] p2:

If a program contains a violation of any diagnosable rule or an occurrence of a
construct described in this Standard as “conditionally-supported” when the
implementation does not support that construct, a conforming implementation
shall issue at least one diagnostic message.

This diagnostics is produced. I'd like to point out that clang behaves
similarly (albeit this is not really relevant when we talk about the
correctness).

Reply via email to