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

           Summary: Crash stemming from typo correction when compiling
                    template subclass
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]


The following code causes clang to crash due to a NULL Decl pointer:

template <typename T>
class Base {
 public:
  typedef long Container;
};

template <typename T>
class Derived : public Base<T> {
 public:
  using Base<T>::Container;

  void foo(const Container& current);
};


The crash is at SemaDecl.cpp:310

309   NamedDecl *Result = Corrected.getCorrectionDecl();
310   if ((isa<TypeDecl>(Result) || isa<ObjCInterfaceDecl>(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.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- 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