public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/52707] New: [C++11] Deleted special member function prevent type being an aggregate
@ 2012-03-25 14:59 daniel.kruegler at googlemail dot com
  2012-04-13 21:16 ` [Bug c++/52707] " jason at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: daniel.kruegler at googlemail dot com @ 2012-03-25 14:59 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 52707
           Summary: [C++11] Deleted special member function prevent type
                    being an aggregate
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: daniel.kruegler@googlemail.com
                CC: jason@gcc.gnu.org


gcc 4.8.0 20120318 (experimental) in C++11 mode rejects the following code:

//---
struct A {
 int m;
 A() = delete;
};

A a = {1}; // line 6
//---

"6|error: could not convert '{1}' from '<brace-enclosed initializer list>' to
'A'|"

But according to N3290 (N3376 still the same) the user-declared, deleted
default-constructor should not prevent A from being an aggregate type and
aggregate initialization should happen here. The error text implies that A is
considered as a non-aggregate and no feasible constructor is found.

According to 8.4.2 p4:

"A function is user-provided if it is user-declared and not explicitly
defaulted or deleted on its first declaration."

and by 8.5.1 p1:

"An aggregate is [..] a class (Clause 9) with no user-provided constructors"

Thus, the deleted default constructor is not a user-provided constructor and
aggregate initialization should work.

This is due to DR 1135 which is already part of C++11:

http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1135


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

end of thread, other threads:[~2013-12-09  9:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-25 14:59 [Bug c++/52707] New: [C++11] Deleted special member function prevent type being an aggregate daniel.kruegler at googlemail dot com
2012-04-13 21:16 ` [Bug c++/52707] " jason at gcc dot gnu.org
2012-04-15 17:15 ` jason at gcc dot gnu.org
2012-04-15 17:16 ` jason at gcc dot gnu.org
2013-12-09  9:36 ` paolo.carlini at oracle dot com
2013-12-09  9:50 ` paolo at gcc dot gnu.org
2013-12-09  9:53 ` paolo.carlini at oracle 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).