[LLVMbugs] [Bug 17949] New: Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Nov 15 13:29:29 PST 2013


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

            Bug ID: 17949
           Summary: Assertion `isa<X>(Val) && "cast<Ty>() argument of
                    incompatible type!"' failed.
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: nlewycky at google.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Crash on invalid. Testcase:

  template <_OutIter> class time_put0 {
  namespace {

'clang -fsyntax-only' is sufficient to reproduce. Clang says:

<stdin>:1:11: error: unknown type name '_OutIter'
template <_OutIter> class time_put0 {
          ^
clang: /usr/local/google/home/nlewycky/llvm/include/llvm/Support/Casting.h:239:
typename llvm::cast_retty<X, Y*>::ret_type llvm::cast(Y*) [with X =
clang::DeclContext, Y = clang::Decl, typename llvm::cast_retty<X, Y*>::ret_type
= clang::DeclContext*]: Assertion `isa<X>(Val) && "cast<Ty>() argument of
incompatible type!"' failed.
0  clang           0x000000000335f2af llvm::sys::PrintStackTrace(_IO_FILE*) +
38
1  clang           0x000000000335f536
2  clang           0x000000000335ef7a
3  libpthread.so.0 0x00007fada0328cb0
4  libc.so.6       0x00007fad9f352425 gsignal + 53
5  libc.so.6       0x00007fad9f355b8b abort + 379
6  libc.so.6       0x00007fad9f34b0ee
7  libc.so.6       0x00007fad9f34b192
8  clang           0x0000000000deb255 llvm::cast_retty<clang::DeclContext,
clang::Decl*>::ret_type llvm::cast<clang::DeclContext,
clang::Decl>(clang::Decl*) + 62
9  clang           0x00000000011f3b23
clang::Parser::ParseCXXMemberSpecification(clang::SourceLocation,
clang::SourceLocation, clang::Parser::ParsedAttributesWithRange&, unsigned int,
clang::Decl*) + 2211
10 clang           0x00000000011f01d6
clang::Parser::ParseClassSpecifier(clang::tok::TokenKind,
clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo
const&, clang::AccessSpecifier, bool, clang::Parser::DeclSpecContext,
clang::Parser::ParsedAttributesWithRange&) + 8244
11 clang           0x00000000011db33f
clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&,
clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier,
clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*) + 8347
12 clang           0x000000000123450f
clang::Parser::ParseSingleDeclarationAfterTemplate(unsigned int,
clang::Parser::ParsedTemplateInfo const&, clang::ParsingDeclRAIIObject&,
clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) + 439
13 clang           0x00000000012342f3
clang::Parser::ParseTemplateDeclarationOrSpecialization(unsigned int,
clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) + 1083
14 clang           0x0000000001233e9e
clang::Parser::ParseDeclarationStartingWithTemplate(unsigned int,
clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) + 214
15 clang           0x00000000011d59dd
clang::Parser::ParseDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, unsigned
int, clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&) + 239
16 clang           0x00000000011c3e60
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) + 1680
17 clang           0x00000000011c379f
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 415
18 clang           0x00000000011bfa9b clang::ParseAST(clang::Sema&, bool, bool)
+ 387
19 clang           0x0000000000d609ef clang::ASTFrontendAction::ExecuteAction()
+ 321
20 clang           0x0000000000fb3720 clang::CodeGenAction::ExecuteAction() +
1414
21 clang           0x0000000000d6052e clang::FrontendAction::Execute() + 200
22 clang           0x0000000000d31bf8
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 720
23 clang           0x0000000000d00526
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1018
24 clang           0x0000000000cf1358 cc1_main(char const**, char const**, char
const*, void*) + 717
25 clang           0x0000000000cfbbf6 main + 786
26 libc.so.6       0x00007fad9f33d76d __libc_start_main + 237
27 clang           0x0000000000cf0a59
Stack dump:
0.      Program arguments:
/usr/local/google/home/nlewycky/llvm/Debug+Asserts/bin/clang -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name -
-mrelocation-model static -mdisable-fp-elim -fmath-errno -masm-verbose
-mconstructor-aliases -munwind-tables -target-cpu x86-64 -target-linker-version
2.22 -resource-dir
/usr/local/google/home/nlewycky/llvm/Debug+Asserts/bin/../lib/clang/3.4
-internal-isystem /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/x86_64-linux-gnu
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/backward
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/x86_64-linux-gnu/c++/4.6
-internal-isystem /usr/local/include -internal-isystem
/usr/local/google/home/nlewycky/llvm/Debug+Asserts/bin/../lib/clang/3.4/include
-internal-externc-isystem /usr/include/x86_64-linux-gnu
-internal-externc-isystem /include -internal-externc-isystem /usr/include
-fdeprecated-macro -fdebug-compilation-dir /usr/local/google/home/nlewycky
-ferror-limit 19 -fmessage-length 80 -mstackrealign -fobjc-runtime=gcc
-fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics
-vectorize-slp -o /tmp/--ea990e.o -x c++ - 
1.      <stdin>:2:3: current parser token 'namespace'
2.      <stdin>:1:21: parsing struct/union/class body 'time_put0'
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.4 (trunk 194757) (llvm/trunk 188326:194757M)
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: Error generating preprocessed source(s) - ignoring
input from stdin.
clang: note: diagnostic msg: Error generating preprocessed source(s) - no
preprocessable inputs.

-- 
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/20131115/2af025d4/attachment.html>


More information about the llvm-bugs mailing list