[PATCH] Fix libstdc++/6811

Paolo Carlini pcarlini@unitus.it
Sun May 26 09:15:00 GMT 2002


Gabriel Dos Reis wrote:

>I gave it more thought: maybe one could try instantiating it and
>pass a flag to GCC to warn about missing return statement.  I don't
>know how far we can get with that.
>
Anyway, I find this very interesting! It seems that many stupid but 
*very* serious bugs don't get caught 'til you have a testing framework 
which thorughly instantiates the various classes...

>| 
>| Ok for both? (tested x86-linux, as usual)
>
>Yes.
>
Thanks. Done.

Could you possibly help a bit with libstdc++/6642?
Currently we cannot compile the trivial:

#include <string>

class MyClass {
private:
  std::string s;
  std::string::iterator it;
public:
  unsigned pos() const {
    return it - s.begin();
  }
};

which mixes a const_iterator and an iterator. The issue is becoming 
clearer to me (read DR179 and DR280) but I'm not sure which is the best fix.

Ciao, Paolo.



More information about the Libstdc++ mailing list