public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/103347] New: Non-static data member initialization is erroneously allowed in C++03 mode
@ 2021-11-21 12:13 fchelnokov at gmail dot com
  2021-11-21 14:50 ` [Bug c++/103347] " pinskia at gcc dot gnu.org
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: fchelnokov at gmail dot com @ 2021-11-21 12:13 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 103347
           Summary: Non-static data member initialization is erroneously
                    allowed in C++03 mode
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: fchelnokov at gmail dot com
  Target Milestone: ---

This code is invalid in C++03 mode:
```
#include <cstddef>
struct test {
    void *x = NULL; //invalid in C++03 mode
};
int main() {}
```
It is rejected by Clang, not not by GCC. Demo:
https://gcc.godbolt.org/z/113EWvzzx

Related discussion: https://stackoverflow.com/q/49618716/7325599

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2021-12-01  2:51 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-21 12:13 [Bug c++/103347] New: Non-static data member initialization is erroneously allowed in C++03 mode fchelnokov at gmail dot com
2021-11-21 14:50 ` [Bug c++/103347] " pinskia at gcc dot gnu.org
2021-11-21 14:52 ` pinskia at gcc dot gnu.org
2021-11-21 14:54 ` pinskia at gcc dot gnu.org
2021-11-21 17:02 ` redi at gcc dot gnu.org
2021-11-22  9:37 ` pinskia at gcc dot gnu.org
2021-11-22  9:38 ` pinskia at gcc dot gnu.org
2021-11-22  9:47 ` pinskia at gcc dot gnu.org
2021-11-22  9:53 ` [Bug c++/103347] [9/10/11/12 Regression] Non-static data member initialization is erroneously allowed in C++03 with assignment to NULL pinskia at gcc dot gnu.org
2021-11-22 16:43 ` jakub at gcc dot gnu.org
2021-11-22 18:19 ` mpolacek at gcc dot gnu.org
2021-11-24  5:24 ` cvs-commit at gcc dot gnu.org
2021-11-24  5:26 ` [Bug c++/103347] [9/10/11 " mpolacek at gcc dot gnu.org
2021-12-01  2:51 ` ensadc at mailnesia dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).