public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/53132] New: Missing top level in diagnostic's instantiation stack
@ 2012-04-26 23:12 jyasskin at gcc dot gnu.org
  2012-05-21 17:48 ` [Bug c++/53132] " paolo.carlini at oracle dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: jyasskin at gcc dot gnu.org @ 2012-04-26 23:12 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 53132
           Summary: Missing top level in diagnostic's instantiation stack
    Classification: Unclassified
           Product: gcc
           Version: 4.7.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: jyasskin@gcc.gnu.org


gcc-4.7's diagnostic about a private copy constructor skips some levels in the
template instantiation stack:

$ cat test.cc
#include <utility>
class Uncopyable {  // 2
 public:
  Uncopyable() = default;
 private:
  Uncopyable(const Uncopyable&);  // 6
};
class ContainsUncopyable {
  std::pair<Uncopyable, int> pv;  // 9
};
void foo() {
  ContainsUncopyable c;  // 12
}

$ g++-4.7pre -c -std=c++11 test.cc
.../include/c++/4.7.1/type_traits: In substitution of ‘template<class _From1,
class _To1> static decltype ((__test_aux<_To1>(declval<_From1>()),
std::__sfinae_types::__one())) std::__is_convertible_helper<_From, _To,
false>::__test(int) [with _From1 = _From1; _To1 = _To1; _From = const
Uncopyable&; _To = Uncopyable] [with _From1 = const Uncopyable&; _To1 =
Uncopyable]’:
.../include/c++/4.7.1/type_traits:1258:70:   required from ‘constexpr const
bool std::__is_convertible_helper<const Uncopyable&, Uncopyable, false>::value’
.../include/c++/4.7.1/type_traits:1263:12:   required from ‘struct
std::is_convertible<const Uncopyable&, Uncopyable>’
.../include/c++/4.7.1/type_traits:116:12:   required from ‘struct
std::__and_<std::is_convertible<const Uncopyable&, Uncopyable>,
std::is_convertible<const int&, int> >’
.../include/c++/4.7.1/bits/stl_pair.h:113:38:   required from here
test.cc:6:3: error: ‘Uncopyable::Uncopyable(const Uncopyable&)’ is private
In file included from .../include/c++/4.7.1/bits/move.h:57:0,
                 from .../include/c++/4.7.1/bits/stl_pair.h:61,
                 from .../include/c++/4.7.1/utility:72,
                 from test.cc:1:
.../include/c++/4.7.1/type_traits:1252:2: error: within this context

# 3 more similar errors omitted


This diagnostic is less readable than it should be because it omits the code I
wrote at test.cc:9 or test.cc:12, which caused the template at stl_pair.h:113
to be instantiated.

I've only seen this in C++11 mode because the std::pair enable_if is only
present there.


$ g++-4.7pre --version
g++-4.7pre (GCC) 4.7.1 20120412 (prerelease)


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

end of thread, other threads:[~2015-07-28  9:37 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-26 23:12 [Bug c++/53132] New: Missing top level in diagnostic's instantiation stack jyasskin at gcc dot gnu.org
2012-05-21 17:48 ` [Bug c++/53132] " paolo.carlini at oracle dot com
2012-05-21 19:31 ` manu at gcc dot gnu.org
2014-11-20 16:50 ` paolo.carlini at oracle dot com
2014-12-19 16:13 ` paolo.carlini at oracle dot com
2014-12-19 16:26 ` manu at gcc dot gnu.org
2014-12-19 17:25 ` paolo.carlini at oracle dot com
2015-07-28  9:37 ` 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).