public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/51556] New: Bizarre member template protection errors
@ 2011-12-14 20:28 luto at mit dot edu
  2011-12-14 20:29 ` [Bug c++/51556] " luto at mit dot edu
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: luto at mit dot edu @ 2011-12-14 20:28 UTC (permalink / raw)
  To: gcc-bugs

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.


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

* [Bug c++/51556] Bizarre member template protection errors
  2011-12-14 20:28 [Bug c++/51556] New: Bizarre member template protection errors luto at mit dot edu
@ 2011-12-14 20:29 ` luto at mit dot edu
  2011-12-14 20:42 ` luto at mit dot edu
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: luto at mit dot edu @ 2011-12-14 20:29 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Andy Lutomirski <luto at mit dot edu> 2011-12-14 20:28:28 UTC ---
Created attachment 26087
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26087
Working test


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

* [Bug c++/51556] Bizarre member template protection errors
  2011-12-14 20:28 [Bug c++/51556] New: Bizarre member template protection errors luto at mit dot edu
  2011-12-14 20:29 ` [Bug c++/51556] " luto at mit dot edu
@ 2011-12-14 20:42 ` luto at mit dot edu
  2011-12-14 21:50 ` manu at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: luto at mit dot edu @ 2011-12-14 20:42 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Andy Lutomirski <luto at mit dot edu> 2011-12-14 20:30:01 UTC ---
Created attachment 26088
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26088
Preprocessed test cases


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

* [Bug c++/51556] Bizarre member template protection errors
  2011-12-14 20:28 [Bug c++/51556] New: Bizarre member template protection errors luto at mit dot edu
  2011-12-14 20:29 ` [Bug c++/51556] " luto at mit dot edu
  2011-12-14 20:42 ` luto at mit dot edu
@ 2011-12-14 21:50 ` manu at gcc dot gnu.org
  2011-12-15  0:03 ` luto at mit dot edu
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: manu at gcc dot gnu.org @ 2011-12-14 21:50 UTC (permalink / raw)
  To: gcc-bugs

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

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |manu at gcc dot gnu.org

--- Comment #3 from Manuel López-Ibáñez <manu at gcc dot gnu.org> 2011-12-14 21:23:13 UTC ---
It fails with GCC 4.7 revision 180166.

It compiles cleanly with clang 3.1.


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

* [Bug c++/51556] Bizarre member template protection errors
  2011-12-14 20:28 [Bug c++/51556] New: Bizarre member template protection errors luto at mit dot edu
                   ` (2 preceding siblings ...)
  2011-12-14 21:50 ` manu at gcc dot gnu.org
@ 2011-12-15  0:03 ` luto at mit dot edu
  2011-12-28 18:41 ` [Bug c++/51556] Bizarre member template access control errors paolo.carlini at oracle dot com
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: luto at mit dot edu @ 2011-12-15  0:03 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Andy Lutomirski <luto at mit dot edu> 2011-12-15 00:00:18 UTC ---
Created attachment 26095
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26095
Partially reduced test case

This is reduced by a combination of fiddling by hand and automated reduction. 
It's still not pretty, but it's considerably shorter than the original version.

I still haven't been able to reproduce the bug from scratch.


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

* [Bug c++/51556] Bizarre member template access control errors
  2011-12-14 20:28 [Bug c++/51556] New: Bizarre member template protection errors luto at mit dot edu
                   ` (3 preceding siblings ...)
  2011-12-15  0:03 ` luto at mit dot edu
@ 2011-12-28 18:41 ` paolo.carlini at oracle dot com
  2012-01-01 13:40 ` paolo.carlini at oracle dot com
  2012-10-05 19:29 ` paolo.carlini at oracle dot com
  6 siblings, 0 replies; 8+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-12-28 18:41 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-12-28 18:12:17 UTC ---
This works with current (Rev 182710) mainline.


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

* [Bug c++/51556] Bizarre member template access control errors
  2011-12-14 20:28 [Bug c++/51556] New: Bizarre member template protection errors luto at mit dot edu
                   ` (4 preceding siblings ...)
  2011-12-28 18:41 ` [Bug c++/51556] Bizarre member template access control errors paolo.carlini at oracle dot com
@ 2012-01-01 13:40 ` paolo.carlini at oracle dot com
  2012-10-05 19:29 ` paolo.carlini at oracle dot com
  6 siblings, 0 replies; 8+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-01-01 13:40 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-01-01 13:40:08 UTC ---
If we can figure out a small testcase we can add it and close the issue as
fixed for 4.7.0.


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

* [Bug c++/51556] Bizarre member template access control errors
  2011-12-14 20:28 [Bug c++/51556] New: Bizarre member template protection errors luto at mit dot edu
                   ` (5 preceding siblings ...)
  2012-01-01 13:40 ` paolo.carlini at oracle dot com
@ 2012-10-05 19:29 ` paolo.carlini at oracle dot com
  6 siblings, 0 replies; 8+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-10-05 19:29 UTC (permalink / raw)
  To: gcc-bugs


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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
      Known to work|                            |4.7.0, 4.8.0
         Resolution|                            |WORKSFORME

--- Comment #7 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-10-05 19:28:51 UTC ---
Works in mainline and 4.7.


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

end of thread, other threads:[~2012-10-05 19:29 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-14 20:28 [Bug c++/51556] New: Bizarre member template protection errors luto at mit dot edu
2011-12-14 20:29 ` [Bug c++/51556] " luto at mit dot edu
2011-12-14 20:42 ` luto at mit dot edu
2011-12-14 21:50 ` manu at gcc dot gnu.org
2011-12-15  0:03 ` luto at mit dot edu
2011-12-28 18:41 ` [Bug c++/51556] Bizarre member template access control errors paolo.carlini at oracle dot com
2012-01-01 13:40 ` paolo.carlini at oracle dot com
2012-10-05 19:29 ` 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).