[Bug c++/11240] Weirdness with reverse_iterator<const char*>

paolo at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Sat Oct 11 10:13:00 GMT 2003


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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



------- Additional Comments From paolo at gcc dot gnu dot org  2003-10-11 10:13 -------
... and templates have nothing to do with it!

Paolo.

/////////

#include <cassert> 

class r_i 
{
protected:
  const char* current;

public:
  r_i(const char* __x) : current(__x) { }

  const char*
  base() const { return current; }
};

int main() 
{ 
  // char s[] = "0";
  const char s[] = "0";

  // r_i r1(s);
  r_i r1 = r_i(s);

  assert( r1.base() == s );
}



More information about the Gcc-bugs mailing list