public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/53734] New: std::is_constructible fails to compile if copy constructor is private
@ 2012-06-20 18:48 maxdebayser at gmail dot com
  2012-06-20 19:04 ` [Bug libstdc++/53734] " redi at gcc dot gnu.org
  2012-06-20 19:08 ` redi at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: maxdebayser at gmail dot com @ 2012-06-20 18:48 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 53734
           Summary: std::is_constructible fails to compile if copy
                    constructor is private
    Classification: Unclassified
           Product: gcc
           Version: 4.7.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: maxdebayser@gmail.com


Created attachment 27666
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27666
Test case with a class with a private copy constructor

Given a class Foo with a private copy constructor, std::is_constructible<Foo,
Foo>::value or std::is_copy_constructible<Foo>::value fail to compile.
Shouldn't this expression successfully compile and result in 0? It works this
way in clang++.
I've attached a test case. The command line used to compile was g++ -std=c++11
test.cpp. The error message is:
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.1/../../../../include/c++/4.7.1/type_traits:
In instantiation of ‘struct std::__is_direct_constructible_impl<NoCopy,
NoCopy>’:
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.1/../../../../include/c++/4.7.1/type_traits:116:12:
  required from ‘struct std::__and_<std::is_destructible<NoCopy>,
std::__is_direct_constructible_impl<NoCopy, NoCopy> >’
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.1/../../../../include/c++/4.7.1/type_traits:778:12:
  required from ‘struct std::__is_direct_constructible_new_safe<NoCopy,
NoCopy>’
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.1/../../../../include/c++/4.7.1/type_traits:856:12:
  required from ‘struct std::__is_direct_constructible_new<NoCopy, NoCopy>’
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.1/../../../../include/c++/4.7.1/type_traits:864:12:
  required from ‘struct std::__is_direct_constructible<NoCopy, NoCopy>’
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.1/../../../../include/c++/4.7.1/type_traits:905:12:
  required from ‘struct std::__is_constructible_impl<NoCopy, NoCopy>’
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.1/../../../../include/c++/4.7.1/type_traits:916:12:
  required from ‘struct std::is_constructible<NoCopy, NoCopy>’
test.cpp:13:95:   required from here
test.cpp:7:2: error: ‘NoCopy::NoCopy(const NoCopy&)’ is private
In file included from
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.1/../../../../include/c++/4.7.1/bits/move.h:57:0,
                 from
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.1/../../../../include/c++/4.7.1/bits/stl_pair.h:61,
                 from
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.1/../../../../include/c++/4.7.1/bits/stl_algobase.h:65,
                 from
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.1/../../../../include/c++/4.7.1/bits/char_traits.h:41,
                 from
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.1/../../../../include/c++/4.7.1/ios:41,
                 from
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.1/../../../../include/c++/4.7.1/ostream:40,
                 from
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.1/../../../../include/c++/4.7.1/iostream:40,
                 from test.cpp:1:
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.1/../../../../include/c++/4.7.1/type_traits:762:43:
error: within this context
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.1/../../../../include/c++/4.7.1/type_traits:
In instantiation of ‘struct std::__is_direct_constructible_impl<NoCopy, const
NoCopy&>’:
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.1/../../../../include/c++/4.7.1/type_traits:116:12:
  required from ‘struct std::__and_<std::is_destructible<NoCopy>,
std::__is_direct_constructible_impl<NoCopy, const NoCopy&> >’
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.1/../../../../include/c++/4.7.1/type_traits:778:12:
  required from ‘struct std::__is_direct_constructible_new_safe<NoCopy, const
NoCopy&>’
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.1/../../../../include/c++/4.7.1/type_traits:856:12:
  required from ‘struct std::__is_direct_constructible_new<NoCopy, const
NoCopy&>’
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.1/../../../../include/c++/4.7.1/type_traits:864:12:
  required from ‘struct std::__is_direct_constructible<NoCopy, const NoCopy&>’
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.1/../../../../include/c++/4.7.1/type_traits:905:12:
  required from ‘struct std::__is_constructible_impl<NoCopy, const NoCopy&>’
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.1/../../../../include/c++/4.7.1/type_traits:916:12:
  required from ‘struct std::is_constructible<NoCopy, const NoCopy&>’
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.1/../../../../include/c++/4.7.1/type_traits:929:12:
  required from ‘struct std::__is_copy_constructible_impl<NoCopy, false>’
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.1/../../../../include/c++/4.7.1/type_traits:935:12:
  required from ‘struct std::is_copy_constructible<NoCopy>’
test.cpp:14:85:   required from here
test.cpp:7:2: error: ‘NoCopy::NoCopy(const NoCopy&)’ is private
In file included from
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.1/../../../../include/c++/4.7.1/bits/move.h:57:0,
                 from
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.1/../../../../include/c++/4.7.1/bits/stl_pair.h:61,
                 from
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.1/../../../../include/c++/4.7.1/bits/stl_algobase.h:65,
                 from
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.1/../../../../include/c++/4.7.1/bits/char_traits.h:41,
                 from
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.1/../../../../include/c++/4.7.1/ios:41,
                 from
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.1/../../../../include/c++/4.7.1/ostream:40,
                 from
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.1/../../../../include/c++/4.7.1/iostream:40,
                 from test.cpp:1:
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.1/../../../../include/c++/4.7.1/type_traits:762:43:
error: within this context


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

* [Bug libstdc++/53734] std::is_constructible fails to compile if copy constructor is private
  2012-06-20 18:48 [Bug libstdc++/53734] New: std::is_constructible fails to compile if copy constructor is private maxdebayser at gmail dot com
@ 2012-06-20 19:04 ` redi at gcc dot gnu.org
  2012-06-20 19:08 ` redi at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: redi at gcc dot gnu.org @ 2012-06-20 19:04 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-06-20 19:04:17 UTC ---
G++ doesn't yet implement access-checking during template deduction.


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

* [Bug libstdc++/53734] std::is_constructible fails to compile if copy constructor is private
  2012-06-20 18:48 [Bug libstdc++/53734] New: std::is_constructible fails to compile if copy constructor is private maxdebayser at gmail dot com
  2012-06-20 19:04 ` [Bug libstdc++/53734] " redi at gcc dot gnu.org
@ 2012-06-20 19:08 ` redi at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: redi at gcc dot gnu.org @ 2012-06-20 19:08 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-06-20 19:08:41 UTC ---
see PR 51213

*** This bug has been marked as a duplicate of bug 51213 ***


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

end of thread, other threads:[~2012-06-20 19:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-20 18:48 [Bug libstdc++/53734] New: std::is_constructible fails to compile if copy constructor is private maxdebayser at gmail dot com
2012-06-20 19:04 ` [Bug libstdc++/53734] " redi at gcc dot gnu.org
2012-06-20 19:08 ` redi at gcc dot gnu.org

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).