public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jyasskin at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/53132] New: Missing top level in diagnostic's instantiation stack
Date: Thu, 26 Apr 2012 23:12:00 -0000	[thread overview]
Message-ID: <bug-53132-4@http.gcc.gnu.org/bugzilla/> (raw)

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)


             reply	other threads:[~2012-04-26 23:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-26 23:12 jyasskin at gcc dot gnu.org [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-53132-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).