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

            Bug ID: 65399
           Summary: error: invalid use of non-static data member
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dcb314 at hotmail dot com

I've just had a go at compiling gcc trunk with clang.
It says

/usr/bin/../lib/gcc/x86_64-redhat-linux/5.0.0/../../../../include/c++/5.0.0/stdexcept:83:28:
error: invalid use of non-static data member '_M_s'

It seems for the attached code, clang and gcc don't agree.

typedef unsigned long size_t;

  struct __sso_string
  {
    struct __str
    {
      const char* _M_p;
      size_t _M_string_length;
      char _M_local_buf[16];
    };

    union {
      __str _M_s;
      char _M_bytes[sizeof(_M_s)];
    };
  };

Reply via email to