[LLVMbugs] [Bug 18653] New: Abort after class declaration as template argument

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Jan 29 00:24:35 PST 2014


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

            Bug ID: 18653
           Summary: Abort after class declaration as template argument
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: pkeir at outlook.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 11968
  --> http://llvm.org/bugs/attachment.cgi?id=11968&action=edit
The C++ code which produces the abort

The attached code causes clang to abort (core dump). The code provides a class
declaration as the template argument to a function call made within a class
template method. I believe this is a C++11 feature, and so I provide the
-std=c++11 flag; though the same error occurs without it.

clang++ -c -std=c++11 declbug.cpp

If I instead declare class newclass outside a code scope, for example outside
the class template, (so changing to external linkage), the abort disappears.

The errors produced start with:

clang:
/home/xxxxx/projects/llvm_src/local_repo/Mon-25-Nov-2013--11-46-50/llvm/tools/clang/lib/Sema/SemaTemplateInstantiate.cpp:2785:
llvm::PointerUnion<Decl *, LocalInstantiationScope::DeclArgumentPack *>
*clang::LocalInstantiationScope::findInstantiationOf(const clang::Decl *):
Assertion `isa<LabelDecl>(D) && "declaration not instantiated in this scope"'
failed.

clang++ --version provides:

clang version 3.4 (ssh://superserver/var/lib/git/clang.git
4695dcd5c247a1848faed59b575909bdf2829888)
(ssh://superserver/var/lib/git/llvm.git
53f84cf3a29b54666bd58749f2fdf9834ef4daa7)
Target: x86_64-unknown-linux-gnu
Thread model: posix

-- 
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/20140129/e8946134/attachment.html>


More information about the llvm-bugs mailing list