[LLVMbugs] [Bug 23341] New: bad diagnostic on "override" in out-of-line definition

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Apr 24 14:38:03 PDT 2015


https://llvm.org/bugs/show_bug.cgi?id=23341

            Bug ID: 23341
           Summary: bad diagnostic on "override" in out-of-line definition
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: nlewycky at google.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Testcase:

class Y {
  virtual void foo();
};
class X : public Y {
  void foo() override;
};

void X::foo() override { }

$ clang b15592394.cc -std=c++11
b15592394.cc:8:15: error: expected function body after function declarator
void X::foo() override { }
              ^
1 error generated.

I wanted something like what we do for static. Something like this:
b15592394.cc:8:1: error: 'static' can only be specified inside the class
      definition
static void X::foo() { }
^~~~~~~

If you're looking at this, please also note related bug 22075 which may be
fixable at the same time.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20150424/4d5866a5/attachment.html>


More information about the llvm-bugs mailing list