-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Closed
Labels
Description
| Bugzilla Link | 10883 |
| Resolution | FIXED |
| Resolved on | Sep 07, 2011 15:27 |
| Version | trunk |
| OS | Linux |
| Reporter | LLVM Bugzilla Contributor |
| CC | @DougGregor |
Extended Description
The following code causes clang to crash due to a NULL Decl pointer:
template
class Base {
public:
typedef long Container;
};
template
class Derived : public Base {
public:
using Base::Container;
void foo(const Container& current);
};
The crash is at SemaDecl.cpp:310
309 NamedDecl *Result = Corrected.getCorrectionDecl();
310 if ((isa(Result) || isa(Result)) &&
311 !Result->isInvalidDecl()) {
(gdb) p Result
$1 = (clang::NamedDecl *) 0x0
Simply put, this is a situation where Sema::CorrectTypo returns a non-keyword correction without an associated NamedDecl.