http://llvm.org/bugs/show_bug.cgi?id=13499

             Bug #: 13499
           Summary: override does not work with templated base class
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified


Following code does not work with the latest clang but works fine with gcc:

#include <iostream>

class Base {
public:
  virtual void Run() const = 0;
};

template<class T>
class Derived : public T {
public:
  void Run() const override { std::cout << "Running\n"; }
};

int main(int argc, char** argv)
{
  Derived<Base> obj;
  obj.Run();
}

Following error appears:

error: only virtual member functions can be marked 'override'
  void Run() const override { std::cout << "Running\n"; }
  ^                ~~~~~~~~

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to