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

            Bug ID: 22075
           Summary: Poor diagnostics emitted when override appears before
                    const in a method declaration
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified

$ cat test.cpp
struct B { virtual void f(); virtual void f() const; };
struct D : B {
  virtual void f() override;
  virtual void f() override const;
};
$ ./bin/clang++ -std=c++11 -c test.cpp
test.cpp:4:16: error: class member cannot be redeclared
  virtual void f() override const;
               ^
test.cpp:3:16: note: previous declaration is here
  virtual void f() override;
               ^
test.cpp:4:28: error: expected ';' at end of declaration list
  virtual void f() override const;
                           ^
                           ;
2 errors generated.

We can probably emit a fixit hint to suggest "const override".  Also, the first
error message seems to be misguided because we fail to consume the const token.

-- 
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