[LLVMbugs] [Bug 14615] New: Assertion `!Init->isValueDependent()' failed.

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Dec 15 19:59:54 PST 2012


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

             Bug #: 14615
           Summary: Assertion `!Init->isValueDependent()' failed.
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: zilla at kayari.org
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Created attachment 9708
  --> http://llvm.org/bugs/attachment.cgi?id=9708
run script

This code, reduced from something I plan to commit to libstdc++, crashes
clang++:

template<class A, class...>
  struct X
  {
  };

template<class ... B>
  struct X<int, B...>
  {
    typedef int type;
    struct valid { };
  };

template<typename A, typename... B,
         typename T = X<A, B...>,
         typename = typename T::valid>
  typename T::type
  check(int);

int i = check<int, char>(1);


$ ~/src/llvm/3.x/bin/clang++ -std=c++11 c2.cc
clang: /home/redi/src/llvm/llvm/tools/clang/lib/AST/Decl.cpp:1401:
clang::APValue*
clang::VarDecl::evaluateValue(llvm::SmallVectorImpl<std::pair<clang::SourceLocation,
clang::PartialDiagnostic> >&) const: Assertion `!Init->isValueDependent()'
failed.
0  clang           0x0000000001d9b5bf
1  clang           0x0000000001d9bac9
2  libpthread.so.0 0x0000003de7c0f500
3  libc.so.6       0x0000003de7036285 gsignal + 53
4  libc.so.6       0x0000003de7037b9b abort + 379
5  libc.so.6       0x0000003de702ee9e
6  libc.so.6       0x0000003de702ef42
7  clang           0x00000000011d273e
clang::VarDecl::evaluateValue(llvm::SmallVectorImpl<std::pair<clang::SourceLocation,
clang::PartialDiagnostic> >&) const + 478
8  clang           0x00000000011d2787 clang::VarDecl::evaluateValue() const +
55
9  clang           0x00000000008e77d9
clang::CodeGen::CodeGenModule::EmitConstantInit(clang::VarDecl const&,
clang::CodeGen::CodeGenFunction*) + 41
10 clang           0x0000000000838eb5
clang::CodeGen::CodeGenModule::EmitGlobalVarDefinition(clang::VarDecl const*) +
1429
11 clang           0x000000000083a0f3
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl) + 547
12 clang           0x000000000083aa25
clang::CodeGen::CodeGenModule::EmitGlobal(clang::GlobalDecl) + 1317
13 clang           0x000000000083ae19
14 clang           0x000000000081a6ac
15 clang           0x0000000000819dd7
16 clang           0x000000000098d048 clang::ParseAST(clang::Sema&, bool, bool)
+ 520
17 clang           0x00000000006b3379 clang::FrontendAction::Execute() + 153
18 clang           0x0000000000697c08
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 344
19 clang           0x000000000067f226
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1478
20 clang           0x0000000000678258 cc1_main(char const**, char const**, char
const*, void*) + 984
21 clang           0x0000000000665b7f main + 719
22 libc.so.6       0x0000003de702169d __libc_start_main + 237
23 clang           0x0000000000677d0d
Stack dump:
0.      Program arguments: /home/redi/src/llvm/3.x/bin/clang -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name
c2.cc -mrelocation-model static -mdisable-fp-elim -fmath-errno -masm-verbose
-mconstructor-aliases -munwind-tables -target-cpu x86-64 -target-linker-version
2.21.53.0.1 -momit-leaf-frame-pointer -resource-dir
/home/redi/src/llvm/3.x/bin/../lib/clang/3.3 -fmodule-cache-path
/var/tmp/clang-module-cache -internal-isystem
/usr/lib/gcc/x86_64-redhat-linux/4.6.3/../../../../include/c++/4.6.3
-internal-isystem
/usr/lib/gcc/x86_64-redhat-linux/4.6.3/../../../../include/c++/4.6.3/x86_64-redhat-linux
-internal-isystem
/usr/lib/gcc/x86_64-redhat-linux/4.6.3/../../../../include/c++/4.6.3/backward
-internal-isystem /usr/local/include -internal-isystem
/home/redi/src/llvm/3.x/bin/../lib/clang/3.3/include -internal-externc-isystem
/include -internal-externc-isystem /usr/include -std=c++11 -fdeprecated-macro
-fdebug-compilation-dir /dev/shm -ferror-limit 19 -fmessage-length 157
-mstackrealign -fobjc-runtime=gcc -fcxx-exceptions -fexceptions
-fdiagnostics-show-option -fcolor-diagnostics -o /tmp/c2-hNOLN3.o -x c++ c2.cc 
1.      <eof> parser at end of file
2.      c2.cc:19:5: LLVM IR generation of declaration 'i'
3.      c2.cc:19:5: Generating code for declaration 'i'
clang: error: unable to execute command: Aborted (core dumped)
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.3 (trunk 170278)
Target: x86_64-unknown-linux-gnu
Thread model: posix
clang: note: diagnostic msg: PLEASE submit a bug report to
http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and
associated run script.
clang: note: diagnostic msg:

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



More information about the llvm-bugs mailing list