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

             Bug #: 50930
           Summary: [C++0x] Valid brace-or-equal-initializer of non-static
                    data member rejected
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: daniel.krueg...@googlemail.com
                CC: ja...@redhat.com


gcc 4.7.0 20111029 (experimental) in C++0x mode rejects the following code

//---
struct nmc {
 nmc() = default;
 nmc(nmc&&) = delete; // line 3
};

struct A { // line 6
 nmc n{};
} a; // line 8
//---

"
In constructor 'constexpr A::A()':
6|error: use of deleted function 'nmc::nmc(nmc&&)'
3|error: declared here
8|note: synthesized method 'constexpr A::A()' first required here
"

It seems that the compiler introduces here a copy-initialization while
initializing the member nmc in the default constructor, but the semantics of
the brace-or-equal-initializer don't allow this as described by 12.6.2 p8 and
8.5.

Reply via email to