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 c++/58328] [C++11] bogus: error: constructor required before non-static data member for


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58328

Richard Smith <richard-gccbugzilla at metafoo dot co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at gcc dot gnu.org,
                   |                            |richard-gccbugzilla@metafoo
                   |                            |.co.uk

--- Comment #3 from Richard Smith <richard-gccbugzilla at metafoo dot co.uk> ---
This is in the area of a core language defect, and IIRC CWG hasn't really
decided which cases should be valid. Clang accepts the code in comment#2 but
rejects the code in comment#0 because, in comment#0, 'A::B::B()' is constexpr,
so Clang triggers the computation of the implicit exception specification of
'A::B::B()' earlier (before the default initializer for 'A::B::y' is parsed).

It seems that g++ more eagerly computes the exception specification for
'A::B::B()'. That seems more in line with the resolution of core issue 1330,
which suggests to me that we should trigger the computation of the exception
specification when we parse the 'B()' expression, so I'm inclined to say that
Clang is in error in accepting the code in comment#2.


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