[llvm-bugs] [Bug 42113] New: ASTContext.cpp:8655: clang::QualType clang::ASTContext::mergeFunctionTypes(clang::QualType, clang::QualType, bool, bool): Assertion `!proto->hasExceptionSpec() && "C++ shouldn't be here"' failed

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Jun 3 04:42:00 PDT 2019


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

            Bug ID: 42113
           Summary: ASTContext.cpp:8655: clang::QualType
                    clang::ASTContext::mergeFunctionTypes(clang::QualType,
                    clang::QualType, bool, bool): Assertion
                    `!proto->hasExceptionSpec() && "C++ shouldn't be
                    here"' failed
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: balarishi.bhogadi at amd.com
                CC: llvm-bugs at lists.llvm.org, neeilans at live.com,
                    richard-llvm at metafoo.co.uk

Not seen this issue till few days back.

Core dump occurs when the below code is compiled:

// clang -c -w foo.c
//--------
#if 3
#define __THROW __attribute__((__nothrow__))
#endif
fn1() { fn2(); }
fn2(const) __THROW;
//--------


The error message:

clang-9:
/home/amd/JENKINS/workspace/CPUPC_Mirror_Branch/llvm/tools/clang/lib/AST/ASTContext.cpp:8655:
clang::QualType clang::ASTContext::mergeFunctionTypes(clang::QualType,
clang::QualType, bool, bool): Assertion `!proto->hasExceptionSpec() && "C++
shouldn't be here"' failed.
Stack dump:
0.      Program arguments:
/home/amd/qa/llvm_binaries/MIRROR-BUILD-1287/bin/clang-9 -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name
foo.c -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 -debugger-tuning=gdb
-coverage-notes-file /home/amd/tmp/foo.gcno -resource-dir
/home/amd/qa/llvm_binaries/MIRROR-BUILD-1287/lib/clang/9.0.0 -internal-isystem
/usr/local/include -internal-isystem
/home/amd/qa/llvm_binaries/MIRROR-BUILD-1287/lib/clang/9.0.0/include
-internal-externc-isystem /usr/include/x86_64-linux-gnu
-internal-externc-isystem /include -internal-externc-isystem /usr/include -w
-fdebug-compilation-dir /home/amd/tmp -ferror-limit 19 -fmessage-length 0
-fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics -faddrsig -o
foo.o -x c foo.c
1.      foo.c:5:19: current parser token ';'
 #0 0x00002b7f40528caa llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/home/amd/qa/llvm_binaries/MIRROR-BUILD-1287/bin/../lib/libLLVM-9svn.so+0x75bcaa)
 #1 0x00002b7f40526bca llvm::sys::RunSignalHandlers()
(/home/amd/qa/llvm_binaries/MIRROR-BUILD-1287/bin/../lib/libLLVM-9svn.so+0x759bca)
 #2 0x00002b7f40526cf7 SignalHandler(int)
(/home/amd/qa/llvm_binaries/MIRROR-BUILD-1287/bin/../lib/libLLVM-9svn.so+0x759cf7)
 #3 0x00002b7f3fbc1390 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x11390)
 #4 0x00002b7f43e04428 raise
/build/glibc-t3gR2i/glibc-2.23/signal/../sysdeps/unix/sysv/linux/raise.c:54:0
 #5 0x00002b7f43e0602a abort /build/glibc-t3gR2i/glibc-2.23/stdlib/abort.c:91:0
 #6 0x00002b7f43dfcbd7 __assert_fail_base
/build/glibc-t3gR2i/glibc-2.23/assert/assert.c:92:0
 #7 0x00002b7f43dfcc82 (/lib/x86_64-linux-gnu/libc.so.6+0x2dc82)
 #8 0x0000000001a2af90 clang::ASTContext::mergeFunctionTypes(clang::QualType,
clang::QualType, bool, bool)
(/home/amd/qa/llvm_binaries/MIRROR-BUILD-1287/bin/clang-9+0x1a2af90)
 #9 0x0000000001a28892 clang::ASTContext::mergeTypes(clang::QualType,
clang::QualType, bool, bool, bool)
(/home/amd/qa/llvm_binaries/MIRROR-BUILD-1287/bin/clang-9+0x1a28892)
#10 0x00000000014ba685
clang::Sema::MergeCompatibleFunctionDecls(clang::FunctionDecl*,
clang::FunctionDecl*, clang::Scope*, bool)
(/home/amd/qa/llvm_binaries/MIRROR-BUILD-1287/bin/clang-9+0x14ba685)
#11 0x00000000014cdd95 clang::Sema::MergeFunctionDecl(clang::FunctionDecl*,
clang::NamedDecl*&, clang::Scope*, bool)
(/home/amd/qa/llvm_binaries/MIRROR-BUILD-1287/bin/clang-9+0x14cdd95)
#12 0x00000000014d80d3 clang::Sema::CheckFunctionDeclaration(clang::Scope*,
clang::FunctionDecl*, clang::LookupResult&, bool)
(/home/amd/qa/llvm_binaries/MIRROR-BUILD-1287/bin/clang-9+0x14d80d3)
#13 0x00000000014de441 clang::Sema::ActOnFunctionDeclarator(clang::Scope*,
clang::Declarator&, clang::DeclContext*, clang::TypeSourceInfo*,
clang::LookupResult&, llvm::MutableArrayRef<clang::TemplateParameterList*>,
bool&) (/home/amd/qa/llvm_binaries/MIRROR-BUILD-1287/bin/clang-9+0x14de441)
#14 0x00000000014e0208 clang::Sema::HandleDeclarator(clang::Scope*,
clang::Declarator&, llvm::MutableArrayRef<clang::TemplateParameterList*>)
(/home/amd/qa/llvm_binaries/MIRROR-BUILD-1287/bin/clang-9+0x14e0208)
#15 0x00000000014e0d3a clang::Sema::ActOnDeclarator(clang::Scope*,
clang::Declarator&)
(/home/amd/qa/llvm_binaries/MIRROR-BUILD-1287/bin/clang-9+0x14e0d3a)
#16 0x000000000131a98d
clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&,
clang::Parser::ParsedTemplateInfo const&, clang::Parser::ForRangeInit*)
(/home/amd/qa/llvm_binaries/MIRROR-BUILD-1287/bin/clang-9+0x131a98d)
#17 0x0000000001326d4d clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&,
clang::DeclaratorContext, clang::SourceLocation*, clang::Parser::ForRangeInit*)
(/home/amd/qa/llvm_binaries/MIRROR-BUILD-1287/bin/clang-9+0x1326d4d)
#18 0x0000000001303307
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier)
(/home/amd/qa/llvm_binaries/MIRROR-BUILD-1287/bin/clang-9+0x1303307)
#19 0x0000000001303af9
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier) (.part.194.constprop.197)
(/home/amd/qa/llvm_binaries/MIRROR-BUILD-1287/bin/clang-9+0x1303af9)
#20 0x0000000001303b9f
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier)
(/home/amd/qa/llvm_binaries/MIRROR-BUILD-1287/bin/clang-9+0x1303b9f)
#21 0x00000000013083b7
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*)
(/home/amd/qa/llvm_binaries/MIRROR-BUILD-1287/bin/clang-9+0x13083b7)
#22 0x0000000001308a61
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, bool)
(/home/amd/qa/llvm_binaries/MIRROR-BUILD-1287/bin/clang-9+0x1308a61)
#23 0x00000000012ff19d clang::ParseAST(clang::Sema&, bool, bool)
(/home/amd/qa/llvm_binaries/MIRROR-BUILD-1287/bin/clang-9+0x12ff19d)
#24 0x0000000000d7b48d clang::CodeGenAction::ExecuteAction()
(/home/amd/qa/llvm_binaries/MIRROR-BUILD-1287/bin/clang-9+0xd7b48d)
#25 0x0000000000baf706 clang::FrontendAction::Execute()
(/home/amd/qa/llvm_binaries/MIRROR-BUILD-1287/bin/clang-9+0xbaf706)
#26 0x0000000000b75d06
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/home/amd/qa/llvm_binaries/MIRROR-BUILD-1287/bin/clang-9+0xb75d06)
#27 0x0000000000c4ebe3
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/home/amd/qa/llvm_binaries/MIRROR-BUILD-1287/bin/clang-9+0xc4ebe3)
#28 0x00000000006d21bd cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/home/amd/qa/llvm_binaries/MIRROR-BUILD-1287/bin/clang-9+0x6d21bd)
#29 0x00000000006cb8bd main
(/home/amd/qa/llvm_binaries/MIRROR-BUILD-1287/bin/clang-9+0x6cb8bd)
#30 0x00002b7f43def830 __libc_start_main
/build/glibc-t3gR2i/glibc-2.23/csu/../csu/libc-start.c:325:0
#31 0x00000000006cd90e _start
(/home/amd/qa/llvm_binaries/MIRROR-BUILD-1287/bin/clang-9+0x6cd90e)
clang-9: error: unable to execute command: Aborted (core dumped)

-- 
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/20190603/c6fe23a3/attachment-0001.html>


More information about the llvm-bugs mailing list