Skip to content

Crash stemming from typo correction when compiling template subclass #11255

@llvmbot

Description

@llvmbot
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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillac++

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions