<html>
<head>
<base href="https://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - Clang fail: Assertion `!Old || Old->getCachedLinkage() == D->getCachedLinkage()' failed"
href="https://llvm.org/bugs/show_bug.cgi?id=23484">23484</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Clang fail: Assertion `!Old || Old->getCachedLinkage() == D->getCachedLinkage()' failed
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>C++
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>anton.mitrokhin@phystech.edu
</td>
</tr>
<tr>
<th>CC</th>
<td>dgregor@apple.com, llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>Reproducer:
// test.cpp:
namespace {
struct l_array_0 {
static l_array_0 init(int v0) {
l_array_0 ret;
ret.array = v0;
return ret;
}
int array;
} ;
};
extern "C" {
void incXY___un_3C_vyi_3C_4_3E__3E_(l_array_0 (*v_));
}
void incXY___un_3C_vyi_3C_4_3E__3E_(l_array_0 (*v_)) {
int a = 0;
return;
}
Compile like (clang 3.4, 3.5, 3.6 and trunk):
clang++ -O2 -m64 -c test.cpp
Output:
clang: /export/users/nightly/llvm/llvm-trunk/tools/clang/lib/AST/Decl.cpp:1341:
static clang::LinkageInfo clang::LinkageComputer::getLVForDecl(const
clang::NamedDecl *, LVComputationKind): Assertion `!Old ||
Old->getCachedLinkage() == D->getCachedLinkage()' failed.
#0 0x244775a llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(llvm/bin-trunk/bin/clang+0x244775a)
#1 0x2448aeb (llvm/bin-trunk/bin/clang+0x2448aeb)
#2 0x3a4820f750 __restore_rt (/lib64/libpthread.so.0+0x3a4820f750)
#3 0x3a47a35c39 __GI_raise (/lib64/libc.so.6+0x3a47a35c39)
#4 0x3a47a37348 __GI_abort (/lib64/libc.so.6+0x3a47a37348)
#5 0x3a47a2eb96 __assert_fail_base (/lib64/libc.so.6+0x3a47a2eb96)
#6 0x3a47a2ec42 (/lib64/libc.so.6+0x3a47a2ec42)
#7 0x1561d89 (llvm/bin-trunk/bin/clang+0x1561d89)
#8 0x1553adb clang::NamedDecl::getLinkageInternal() const
(llvm/bin-trunk/bin/clang+0x1553adb)
#9 0xc3dada clang::Sema::ActOnFunctionDeclarator(clang::Scope*,
clang::Declarator&, clang::DeclContext*, clang::TypeSourceInfo*,
clang::LookupResult&, llvm::MutableArrayRef<clang::TemplateParameterList*>,
bool&) (llvm/bin-trunk/bin/clang+0xc3dada)
#10 0xc38045 clang::Sema::HandleDeclarator(clang::Scope*, clang::Declarator&,
llvm::MutableArrayRef<clang::TemplateParameterList*>)
(llvm/bin-trunk/bin/clang+0xc38045)
#11 0xc54979 clang::Sema::ActOnStartOfFunctionDef(clang::Scope*,
clang::Declarator&) (llvm/bin-trunk/bin/clang+0xc54979)
#12 0xad0b00 clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&,
clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*)
(llvm/bin-trunk/bin/clang+0xad0b00)
#13 0xae2613 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, unsigned
int, clang::SourceLocation*, clang::Parser::ForRangeInit*)
(llvm/bin-trunk/bin/clang+0xae2613)
#14 0xad0271
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier)
(llvm/bin-trunk/bin/clang+0xad0271)
#15 0xacfcbc
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier)
(llvm/bin-trunk/bin/clang+0xacfcbc)
#16 0xacedd0
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) (llvm/bin-trunk/bin/clang+0xacedd0)
#17 0xace43b
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&)
(llvm/bin-trunk/bin/clang+0xace43b)
#18 0xaca2e6 clang::ParseAST(clang::Sema&, bool, bool)
(llvm/bin-trunk/bin/clang+0xaca2e6)
#19 0x6c475e clang::FrontendAction::Execute()
(llvm/bin-trunk/bin/clang+0x6c475e)
#20 0x6950ec clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(llvm/bin-trunk/bin/clang+0x6950ec)
#21 0x678018 clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(llvm/bin-trunk/bin/clang+0x678018)
#22 0x66f3fe cc1_main(llvm::ArrayRef<char const*>, char const*, void*)
(llvm/bin-trunk/bin/clang+0x66f3fe)
#23 0x676830 main (llvm/bin-trunk/bin/clang+0x676830)
#24 0x3a47a21d65 __libc_start_main (/lib64/libc.so.6+0x3a47a21d65)
#25 0x66f0ed _start (llvm/bin-trunk/bin/clang+0x66f0ed)
Stack dump:
0. Program arguments: llvm/bin-trunk/bin/clang -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -disable-free -main-file-name test.cpp
-mrelocation-model static -mthread-model posix -fmath-errno -masm-verbose
-mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64
-target-linker-version 2.23.2 -momit-leaf-frame-pointer -dwarf-column-info
-fno-unique-section-names -coverage-file test_dir/test.cpp -resource-dir
llvm/bin-trunk/bin/../lib/clang/3.7.0
-I/opt/intel/composer_xe_2015.2.164/ipp/include
-I/opt/intel/composer_xe_2015.2.164/mkl/include
-I/opt/intel/composer_xe_2015.2.164/tbb/include -internal-isystem
/usr/lib/gcc/x86_64-redhat-linux/4.8.2/../../../../include/c++/4.8.2
-internal-isystem
/usr/lib/gcc/x86_64-redhat-linux/4.8.2/../../../../include/c++/4.8.2/x86_64-redhat-linux
-internal-isystem
/usr/lib/gcc/x86_64-redhat-linux/4.8.2/../../../../include/c++/4.8.2/backward
-internal-isystem /usr/local/include -internal-isystem
llvm/bin-trunk/bin/../lib/clang/3.7.0/include -internal-externc-isystem
/include -internal-externc-isystem /usr/include -O2 -fdeprecated-macro
-fdebug-compilation-dir test_dir-ferror-limit 19 -fmessage-length 271
-mstackrealign -fobjc-runtime=gcc -fcxx-exceptions -fexceptions
-fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp
-o test.o -x c++ test.cpp
1. test.cpp:20:54: current parser token '{'
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.7.0 (trunk 236959)
Target: x86_64-unknown-linux-gnu
Thread model: posix
clang: note: diagnostic msg: PLEASE submit a bug report to
<a href="http://llvm.org/bugs/">http://llvm.org/bugs/</a> and include the crash backtrace, preprocessed source, and
associated run script.
clang: note: diagnostic msg:
********************</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>