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

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Aug 18 00:34:44 PDT 2015


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

            Bug ID: 24483
           Summary: Assertion `isa<X>(Val) && "cast<Ty>() argument of
                    incompatible type!"' failed.
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: octoploid at yandex.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

% cat foo.ii
template <typename> struct A;
template <typename... T> A<T...> models;
template <> struct B models<>


 % clang++ -std=c++14 -c foo.ii
foo.ii:2:26: error: too few template arguments for class template 'A'
template <typename... T> A<T...> models;
                         ^
clang-3.8: /var/tmp/llvm/include/llvm/Support/Casting.h:237: typename
llvm::cast_retty<X, Y*>::ret_type llvm::cast(Y*) [with X =
clang::TypeAliasTemplateDecl; Y = clang::Decl; typename llvm::cast_retty<X,
Y*>::ret_type = clang::TypeAliasTemplateDecl*]: Assertion `isa<X>(Val) &&
"cast<Ty>() argument of incompatible type!"' failed.
#0 0x1087825 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/usr/local/bin/clang-3.8+0x1087825)
#1 0x108632d llvm::sys::RunSignalHandlers()
(/usr/local/bin/clang-3.8+0x108632d)
#2 0x1086505 SignalHandler(int) (/usr/local/bin/clang-3.8+0x1086505)
#3 0x7f1904741230 __restore_rt (/lib/libpthread.so.0+0x11230)
#4 0x7f1903fc9678 __GI_raise
/var/tmp/glibc/signal/../sysdeps/unix/sysv/linux/raise.c:55:0
#5 0x7f1903fcab9d __GI_abort /var/tmp/glibc/stdlib/abort.c:91:0
#6 0x7f1903fc22f7 __assert_fail_base /var/tmp/glibc/assert/assert.c:92:0
#7 0x7f1903fc23a2 (/lib/libc.so.6+0x2c3a2)
#8 0x1e4e412 (/usr/local/bin/clang-3.8+0x1e4e412)
#9 0x1aed3a3 clang::Sema::EmitCurrentDiagnostic(unsigned int)
(/usr/local/bin/clang-3.8+0x1aed3a3)
#10 0x1ac6f13 clang::Sema::SemaDiagnosticBuilder::~SemaDiagnosticBuilder()
(/usr/local/bin/clang-3.8+0x1ac6f13)
#11 0x1db2b74 diagnoseArityMismatch(clang::Sema&, clang::TemplateDecl*,
clang::SourceLocation, clang::TemplateArgumentListInfo&) [clone
.constprop.4522] (/usr/local/bin/clang-3.8+0x1db2b74)
#12 0x1dbf5e8 clang::Sema::CheckTemplateArgumentList(clang::TemplateDecl*,
clang::SourceLocation, clang::TemplateArgumentListInfo&, bool,
llvm::SmallVectorImpl<clang::TemplateArgument>&)
(/usr/local/bin/clang-3.8+0x1dbf5e8)
#13 0x1dbfa67 clang::Sema::CheckTemplateIdType(clang::TemplateName,
clang::SourceLocation, clang::TemplateArgumentListInfo&)
(/usr/local/bin/clang-3.8+0x1dbfa67)
#14 0x1e41da9 clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformTemplateSpecializationType(clang::TypeLocBuilder&,
clang::TemplateSpecializationTypeLoc, clang::TemplateName)
(/usr/local/bin/clang-3.8+0x1e41da9)
#15 0x1e33c13 clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformType(clang::TypeLocBuilder&,
clang::TypeLoc) (/usr/local/bin/clang-3.8+0x1e33c13)
#16 0x1e34b3a clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformType(clang::TypeSourceInfo*)
(/usr/local/bin/clang-3.8+0x1e34b3a)
#17 0x1e34c11 clang::Sema::SubstType(clang::TypeSourceInfo*,
clang::MultiLevelTemplateArgumentList const&, clang::SourceLocation,
clang::DeclarationName) (/usr/local/bin/clang-3.8+0x1e34c11)
#18 0x1dce2e1 clang::Sema::ActOnVarTemplateSpecialization(clang::Scope*,
clang::Declarator&, clang::TypeSourceInfo*, clang::SourceLocation,
clang::TemplateParameterList*, clang::StorageClass, bool)
(/usr/local/bin/clang-3.8+0x1dce2e1)
#19 0x1b85573 clang::Sema::ActOnVariableDeclarator(clang::Scope*,
clang::Declarator&, clang::DeclContext*, clang::TypeSourceInfo*,
clang::LookupResult&, llvm::MutableArrayRef<clang::TemplateParameterList*>,
bool&) (/usr/local/bin/clang-3.8+0x1b85573)
#20 0x1b92133 clang::Sema::HandleDeclarator(clang::Scope*, clang::Declarator&,
llvm::MutableArrayRef<clang::TemplateParameterList*>)
(/usr/local/bin/clang-3.8+0x1b92133)
#21 0x1db2099 clang::Sema::ActOnTemplateDeclarator(clang::Scope*,
llvm::MutableArrayRef<clang::TemplateParameterList*>, clang::Declarator&)
(/usr/local/bin/clang-3.8+0x1db2099)
#22 0x194e95d
clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&,
clang::Parser::ParsedTemplateInfo const&, clang::Parser::ForRangeInit*)
(/usr/local/bin/clang-3.8+0x194e95d)
#23 0x19bb112 clang::Parser::ParseSingleDeclarationAfterTemplate(unsigned int,
clang::Parser::ParsedTemplateInfo const&, clang::ParsingDeclRAIIObject&,
clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*)
(/usr/local/bin/clang-3.8+0x19bb112)
#24 0x19bc855 clang::Parser::ParseTemplateDeclarationOrSpecialization(unsigned
int, clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*)
(/usr/local/bin/clang-3.8+0x19bc855)
#25 0x19bcb41 clang::Parser::ParseDeclarationStartingWithTemplate(unsigned int,
clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*)
(/usr/local/bin/clang-3.8+0x19bcb41)
#26 0x195d667 clang::Parser::ParseDeclaration(unsigned int,
clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&)
(/usr/local/bin/clang-3.8+0x195d667)
#27 0x1942f39
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) (/usr/local/bin/clang-3.8+0x1942f39)
#28 0x1943841
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&)
(/usr/local/bin/clang-3.8+0x1943841)
#29 0x193c2fb clang::ParseAST(clang::Sema&, bool, bool)
(/usr/local/bin/clang-3.8+0x193c2fb)
#30 0x1691257 clang::CodeGenAction::ExecuteAction()
(/usr/local/bin/clang-3.8+0x1691257)
#31 0x1409b16 clang::FrontendAction::Execute()
(/usr/local/bin/clang-3.8+0x1409b16)
#32 0x13e56a1 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/usr/local/bin/clang-3.8+0x13e56a1)
#33 0x1487419 clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/usr/local/bin/clang-3.8+0x1487419)
#34 0x7691b8 cc1_main(llvm::ArrayRef<char const*>, char const*, void*)
(/usr/local/bin/clang-3.8+0x7691b8)
#35 0x7434c7 main (/usr/local/bin/clang-3.8+0x7434c7)
#36 0x7f1903fb64f0 __libc_start_main /var/tmp/glibc/csu/libc-start.c:323:0
#37 0x765719 _start /var/tmp/glibc/csu/../sysdeps/x86_64/start.S:121:0
Stack dump:
0.      Program arguments: /usr/local/bin/clang-3.8 -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name
foo.ii -mrelocation-model static -mthread-model posix -mdisable-fp-elim
-fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables
-fuse-init-array -target-cpu x86-64 -dwarf-column-info -coverage-file
/var/tmp/foo.ii -resource-dir /usr/local/bin/../lib/clang/3.8.0 -std=c++14
-fdeprecated-macro -fdebug-compilation-dir /var/tmp -ferror-limit 19
-fmessage-length 174 -mstackrealign -fobjc-runtime=gcc -fcxx-exceptions
-fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o foo.o -x
c++-cpp-output foo.ii 
1.      <eof> parser at end of file
clang-3.8: error: unable to execute command: Aborted
clang-3.8: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.8.0 (http://llvm.org/git/clang.git
55717dfc0da9c02d3cc5a4f8cccb5f9996b835ec) (http://llvm.org/git/llvm.git
cbdd65c7954ff5df6a33f40251dcb1fe3d7eeaee)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin
clang-3.8: 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-3.8: 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/20150818/bfe09419/attachment-0001.html>


More information about the llvm-bugs mailing list