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

2012-03-01 Thread crimaniak at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52458

 Bug #: 52458
   Summary: [c++0x] compiler fails on for(:*this) with non-public
inheritance with message: Internal compiler error:
Error reporting routines re-entered.
Classification: Unclassified
   Product: gcc
   Version: 4.6.2
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: criman...@gmail.com


Created attachment 26805
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26805
preprocessed code

Command line: c++ -std=c++0x -save-temps bug1.cpp
Code:

#include 
/*#include */

#if false
class V : publicstd::vector
#else
class V : protected std::vector
#endif
{
public:
  void echo(){for(int x:*this) /*std::cout << ' ' << x */ ;};
};


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

Change false to true in #if directive and code will be compiled succesfully.


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

2012-03-01 Thread crimaniak at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52458

--- Comment #1 from Alexey Kulentsov  2012-03-02 
02:19:02 UTC ---
Created attachment 26806
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26806
-v compiler output


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

2012-03-02 Thread crimaniak at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52458

--- Comment #5 from Alexey Kulentsov  2012-03-02 
14:49:41 UTC ---
(In reply to comment #4)

>It works ok if you do the conversion to the base class explicitly:
 Yes, I just make public inheritance so this problem is non-blocking for me,
but this was a bug so I post it. It's pity MinGW updated only to 4.6.2.

> I think the range-for code needs to do overload resolution in the class' 
> scope,
> but it fails to and tries to say the begin/end members are protected, then 
> gets
> into trouble while trying to print the error message.

Agree. Diagnostics problem.