[Bug c++/89305] New: CWG DR 253 is not implemented

raphael.kubo.da.costa at intel dot com gcc-bugzilla@gcc.gnu.org
Tue Feb 12 12:58:00 GMT 2019


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

            Bug ID: 89305
           Summary: CWG DR 253 is not implemented
           Product: gcc
           Version: 8.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: raphael.kubo.da.costa at intel dot com
  Target Milestone: ---

I can see a few bugs marked as SUSPENDED related to DR 253 and how there hadn't
been an official resolution at the time.

According to
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0490r0.html and
http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#253 it's part of
C++17 (even though MSVC and clang implement it for older versions as well).

IOW, I believe G++ should accept the following code:

struct S {
};

struct T {
  T() {}
  const S s_;
};

rather than failing with 

const.cc: In constructor ‘T::T()’:
const.cc:5:3: error: uninitialized const member in ‘const struct S’
[-fpermissive]
   T() {}
   ^
const.cc:6:11: note: ‘const S T::s_’ should be initialized
   const S s_;
           ^~


More information about the Gcc-bugs mailing list