Template w/derived func return type equivalence bug

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Template w/derived func return type equivalence bug

david raila
I've distilled an issue that I'm having down to the following code snippet,
which I believe should compile, but instead clang is flagging "not
covariant" return types...

#include<stdexcept>

class base : public std::exception
{
public:
  virtual base * move() throw () = 0;
};

template <typename T>
class derived : public base
{
public:
         derived *move() throw() {return 0;}
};

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Template w/derived func return type equivalence bug

Douglas Gregor

On Jan 25, 2010, at 3:34 PM, david raila wrote:

> I've distilled an issue that I'm having down to the following code snippet,
> which I believe should compile, but instead clang is flagging "not
> covariant" return types...
>
> #include<stdexcept>
>
> class base : public std::exception
> {
> public:
>  virtual base * move() throw () = 0;
> };
>
> template <typename T>
> class derived : public base
> {
> public:
>         derived *move() throw() {return 0;}
> };

Definitely a bug. Could you file a Bugzilla at http://llvm.org/bugs/ so we don't lose track of this bug?

        - Doug
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev