This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/51556] New: Bizarre member template protection errors
- From: "luto at mit dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 14 Dec 2011 20:28:02 +0000
- Subject: [Bug c++/51556] New: Bizarre member template protection errors
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51556
Bug #: 51556
Summary: Bizarre member template protection errors
Classification: Unclassified
Product: gcc
Version: 4.6.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: luto@mit.edu
Created attachment 26086
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26086
Failing test
I'm not really sure what's going on here, so this test case isn't very well
reduced.
multiindex_success.cc compiles (as IMO it should). multiindex_failure.cc fails
to compile (which is IMO wrong) with this error:
/usr/include/boost/multi_index/detail/index_base.hpp: In member function âvoid
A::Test2(const Irrelevant&) [with Irrelevant = int]â:
/usr/include/boost/multi_index/detail/index_base.hpp:49:44: error: âtypedef
struct boost::multi_index::detail::index_node_base<Entry, std::allocator<Entry>
> boost::multi_index::detail::index_base<Entry,
boost::multi_index::indexed_by<boost::multi_index::ordered_unique<boost::multi_index::tag<A::ById>,
boost::multi_index::member<Entry, int, &Entry::id> > >, std::allocator<Entry>
>::node_typeâ is protected
multiindex_failure.cc:42:11: error: within this context
The error is garbage, since there is no reference to node_type in that context.
The two test cases are identical except that I've reversed the order of two
member functions.
Preprocessed source attached, because I haven't yet reproduced this without
using boost libraries.
Seen on g++ (GCC) 4.6.2 20111027 (Red Hat 4.6.2-1) and an old-ish 4.7 trunk
build.