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

            Bug ID: 20626
           Summary: Typo correction removing base class specificer causes
                    assertion failure later
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

test.cc:
class A {
 public:
  void Foo() {};
};

class B {};

class C : public A, public B {
  void Run() {
    B::Foo();
  }
};

commandline:
clang -fsyntax-only test.cc

assertion:
lib/Sema/SemaDeclCXX.cpp:1715
Assertion `DerivationOkay && "Can only be used with a derived-to-base
conversion"' failed.

diagnostic messages before crash:
test.cc:10:5: error: no member named 'Foo' in 'B'; did you mean simply 'Foo'?
    B::Foo();
    ^~~~~~
    Foo
test.cc:3:8: note: 'Foo' declared here
  void Foo() {};
       ^

Theory:
At SemaExpr.cpp:1921, "B::foo();" is corrected to "foo();"  Later, at
SemaDeclCXX.cpp:1715, foo() is known to be from class A, but it still performs
a class B is derived from class A check, as if the "B::" was still there.

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