https://bugs.llvm.org/show_bug.cgi?id=38189
Bug ID: 38189
Summary: Assertion failure after bad typo correction
Product: clang
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: Frontend
Assignee: unassignedclangb...@nondot.org
Reporter: rtr...@google.com
CC: llvm-bugs@lists.llvm.org
In the following example, the using declaration is incorrect since it refers to
a non-existent class. Clang attempts to typo-correct this, but the correction
is a function instead of a class. This later triggers an assertion.
$ cat test.cc
template <class T>
struct ptr {
ptr(T*);
};
namespace NS {
struct _First__End_ {
static ptr<_First__End_> New_SecondPart__End_();
};
} // namespace NS
using NS::_First__SecondPart__End_;
void run() {
ptr<_First__SecondPart__End_> un = _First__SecondPart__End_::NewInstance();
}
$ clang test.cc
test.cc:12:7: error: no member named '_First__SecondPart__End_' in namespace
'NS'; did you mean 'NS::_First__End_::New_SecondPart__End_'?
using NS::_First__SecondPart__End_;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
NS::_First__End_::New_SecondPart__End_
test.cc:8:28: note: 'NS::_First__End_::New_SecondPart__End_' declared here
static ptr<_First__End_> New_SecondPart__End_();
^
test.cc:15:7: error: use of undeclared identifier '_First__SecondPart__End_';
did you mean 'New_SecondPart__End_'?
ptr<_First__SecondPart__End_> un = _First__SecondPart__End_::NewInstance();
^~~~~~~~~~~~~~~~~~~~~~~~
New_SecondPart__End_
test.cc:12:11: note: 'New_SecondPart__End_' declared here
using NS::_First__SecondPart__End_;
^
clang-7.0: ../tools/clang/lib/Sema/SemaExprMember.cpp:91: IMAKind
ClassifyImplicitMemberAccess(clang::Sema &, const clang::LookupResult &):
Assertion `!R.empty() && (*R.begin())->isCXXClassMember()' failed.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs