[LLVMbugs] [Bug 24212] New: ICE on use of alias template resulting in array type nested within class template

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Jul 22 08:06:25 PDT 2015


https://llvm.org/bugs/show_bug.cgi?id=24212

            Bug ID: 24212
           Summary: ICE on use of alias template resulting in array type
                    nested within class template
           Product: clang
           Version: 3.7
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
          Assignee: unassignedclangbugs at nondot.org
          Reporter: ed at catmur.co.uk
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

The following program crashes clang++ (versions up to 3.7):

template<int I>
struct S {
  template<int J> using T = int[J];
  using U = T<I>;
};
S<3>::U a;

UNREACHABLE executed!
0  libLLVM-3.4.so  0x00007f7e80d695d2 llvm::sys::PrintStackTrace(_IO_FILE*) +
34
1  libLLVM-3.4.so  0x00007f7e80d69dfa
2  libpthread.so.0 0x00007f7e7fbc8710
3  libc.so.6       0x00007f7e7e87e625 gsignal + 53
4  libc.so.6       0x00007f7e7e87fe05 abort + 373
5  libLLVM-3.4.so  0x00007f7e80d549c4 llvm::llvm_unreachable_internal(char
const*, char const*, unsigned int) + 356
6  clang           0x00000000007aaa1f
clang::CodeGen::CodeGenTypes::ConvertType(clang::QualType) + 415
7  clang           0x00000000007ab30e
clang::CodeGen::CodeGenTypes::ConvertTypeForMem(clang::QualType) + 30
8  clang           0x0000000000759d0b
clang::CodeGen::CodeGenModule::EmitNullConstant(clang::QualType) + 187
9  clang           0x0000000000790c8f
clang::CodeGen::CodeGenModule::EmitGlobalVarDefinition(clang::VarDecl const*) +
1487
10 clang           0x000000000079613f
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl) + 159
11 clang           0x000000000079668d
clang::CodeGen::CodeGenModule::EmitGlobal(clang::GlobalDecl) + 941
12 clang           0x000000000079699b
clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) + 299
13 clang           0x000000000073c0bb
14 clang           0x000000000073b349
15 clang           0x00000000008c9e67 clang::ParseAST(clang::Sema&, bool, bool)
+ 487
16 clang           0x000000000073ab46 clang::CodeGenAction::ExecuteAction() +
70
17 clang           0x00000000005bccf2 clang::FrontendAction::Execute() + 210
18 clang           0x00000000005982cd
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 285
19 clang           0x000000000057dc5a
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1642
20 clang           0x0000000000573bc0 cc1_main(char const**, char const**, char
const*, void*) + 1184
21 clang           0x000000000057c264 main + 7636
22 libc.so.6       0x00007f7e7e86ad5d __libc_start_main + 253
23 clang           0x0000000000573529

Interestingly, supplying an equivalent alias template at (any) namespace scope
suppresses the bug:

namespace magic { template<int I> using unused = int[I]; }
template<int I>
struct S {
  template<int J> using T = int[J];
  using U = T<I>;
};
S<3>::U a; // OK

-- 
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/20150722/1d6d4492/attachment.html>


More information about the llvm-bugs mailing list