This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/64367] [5 Regression] g++-v5/stdexcept:52:28: error: invalid use of non-static data member '_M_p'


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

--- Comment #2 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
It doesn't accept your example for C++98, too. C++11 is fine.

markus@x4 ~ % cat test.ii
union u
{
  const char *_M_p;
  char _M_bytes[sizeof (_M_p)];
};

markus@x4 ~ % clang++ -std=c++11 -O2 -c test.ii
markus@x4 ~ % clang++ -O2 -c test.ii
test.ii:4:25: error: invalid use of non-static data member '_M_p'
  char _M_bytes[sizeof (_M_p)];
                        ^~~~
1 error generated.
markus@x4 ~ % 

This looks correct to me.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]