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();
}