[llvm-bugs] [Bug 32644] New: suppress error about 'override' when the base is incomplete

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Apr 12 14:49:12 PDT 2017


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

            Bug ID: 32644
           Summary: suppress error about 'override' when the base is
                    incomplete
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: nlewycky at google.com
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org

Testcase:

class ForgotTheInclude;

class C : public ForgotTheInclude {
  void f() override {}
};

$ clang++ -std=c++11 b18043312.cc 
b18043312.cc:3:18: error: base class has incomplete type
class C : public ForgotTheInclude {
          ~~~~~~~^~~~~~~~~~~~~~~~
b18043312.cc:1:7: note: forward declaration of 'ForgotTheInclude'
class ForgotTheInclude;
      ^
b18043312.cc:4:12: error: only virtual member functions can be marked
'override'
  void f() override {}
           ^~~~~~~~~
2 errors generated.

The second error is extraneous because we don't know whether the method is
virtual or not. If you like, as an error recovery you can go ahead and mark it
virtual in what's left of the AST.

-- 
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/20170412/7afe5923/attachment-0001.html>


More information about the llvm-bugs mailing list