[LLVMbugs] [Bug 21933] New: Crash on using declaration in member function of class template

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Dec 16 14:59:09 PST 2014


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

            Bug ID: 21933
           Summary: Crash on using declaration in member function of class
                    template
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: rnk at google.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Consider:

struct Base { int member; };
template <typename T>
struct A : public T {
  static void StaticFun() {
    using T::member;
    //(void)member; // error: may not access member in static method.
  }
};
template class Derived<Base>;

$ clang -cc1 t.cpp
Stack dump:
0.      Program arguments: D:\src\llvm\build_debug\bin\clang.exe -cc1 t.cpp
1.      t.cpp:20:3: current parser token '}'
2.      t.cpp:16:1: parsing struct/union/class body 'A'
3.      t.cpp:17:27: parsing function body 'StaticFun'
4.      t.cpp:17:27: in compound statement ('{}')
llvm::isa_impl_cl<clang::CXXRecordDecl,clang::DeclContext const *>::doit()
llvm::isa_impl_wrap<clang::CXXRecordDecl,clang::DeclContext const
*,clang::DeclContext const *>::doit()
llvm::isa_impl_wrap<clang::CXXRecordDecl,clang::DeclContext *
const,clang::DeclContext const *>::doit()
llvm::isa<clang::CXXRecordDecl,clang::DeclContext *>() + 0xC bytes(s),
d:\src\llvm\include\llvm\support\casting.h, line 134
llvm::dyn_cast<clang::CXXRecordDecl,clang::DeclContext>() + 0x14 bytes(s),
d:\src\llvm\include\llvm\support\casting.h, line 298
clang::Sema::CheckUsingDeclQualifier() + 0x74 bytes(s),
d:\src\llvm\tools\clang\lib\sema\semadeclcxx.cpp, line 8193
clang::Sema::BuildUsingDeclaration() + 0x2A7 bytes(s),
d:\src\llvm\tools\clang\lib\sema\semadeclcxx.cpp, line 7937
clang::Sema::ActOnUsingDeclaration() + 0x313 bytes(s),
d:\src\llvm\tools\clang\lib\sema\semadeclcxx.cpp, line 7556

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20141216/8bba33db/attachment.html>


More information about the llvm-bugs mailing list