public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/57153] New: [C++11] tries to use copy constructor for in-class initialized member in default constructor of template struct
@ 2013-05-03  3:03 f.heckenbach@fh-soft.de
  2013-05-06 12:09 ` [Bug c++/57153] " daniel.kruegler at googlemail dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: f.heckenbach@fh-soft.de @ 2013-05-03  3:03 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 57153
           Summary: [C++11] tries to use copy constructor for in-class
                    initialized member in default constructor of template
                    struct
    Classification: Unclassified
           Product: gcc
           Version: 4.7.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: f.heckenbach@fh-soft.de


Created attachment 30014
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30014
Test case

The included test case produces the following error:

% g++-4.7 -std=c++11 test.cpp 
test.cpp: In constructor 'constexpr B<0>::B()':
test.cpp:8:8: error: use of deleted function 'A::A(const A&)'
test.cpp:4:3: error: declared here
test.cpp: In function 'int main()':
test.cpp:17:9: note: synthesized method 'constexpr B<0>::B()' first required
here 

I don't think a copy constructor of the member should be needed for the default
constructor of the containing struct.

The error disappears when I declare the latter explicitly, but not when I
declare it as "= default".

Is also disappears if struct B is not a template. I don't see why this should
make a difference.


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

end of thread, other threads:[~2014-11-18 11:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-03  3:03 [Bug c++/57153] New: [C++11] tries to use copy constructor for in-class initialized member in default constructor of template struct f.heckenbach@fh-soft.de
2013-05-06 12:09 ` [Bug c++/57153] " daniel.kruegler at googlemail dot com
2014-11-18 10:46 ` paolo.carlini at oracle dot com
2014-11-18 11:38 ` 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).