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] New: [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

             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: unassigned@gcc.gnu.org
        ReportedBy: crimaniak@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 <vector>
/*#include <iostream>*/

#if false
class V : public    std::vector<int>
#else
class V : protected std::vector<int>
#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.


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