This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/52458] [c++0x] compiler fails on for(:*this) with non-public inheritance with message: Internal compiler error: Error reporting routines re-entered.


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-valid-code
      Known to fail|                            |4.6.2

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-03-02 10:34:56 UTC ---
(In reply to comment #2)
> trunk gives:
> 
> l.cc:18:16: error: âstd::vector<int>â is not an accessible base of âVâ
> 
> which is better than ICE but still wrong, I think

Oops, I was distracted by the range-for loop. That error is for the call to
a.resize() which is of course invalid.

But this valid code still gets an ICE from 4.6

#include <vector>

class V : protected std::vector<int>
{
public:
  void echo()
  {
      for (int x:*this) { }
  }
};


int main()
{
    V a;
    a.echo();
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]