<html>
<head>
<base href="https://bugs.llvm.org/">
</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 - ICE with alias attribute and placeholder for return type deduction"
href="https://bugs.llvm.org/show_bug.cgi?id=33988">33988</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>ICE with alias attribute and placeholder for return type deduction
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>All
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</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++14
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>hstong@ca.ibm.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>Clang ICEs when an alias is defined using a placeholder type.
### SOURCE (<stdin>):
extern "C" auto bar() { return 0; }
auto f() __attribute__((__alias__("bar")));
### COMPILER INVOCATION:
clang++ -cc1 -triple x86_64-unknown-linux-gnu -emit-llvm -o /dev/null -x c++
-std=c++14 -
### ACTUAL OUTPUT:
<stdin>:1:17: warning: 'bar' has C-linkage specified, but returns user-defined
type 'auto' which is incompatible with C
extern "C" auto bar() { return 0; }
^
#0 0x00000000019f9454 PrintStackTraceSignalHandler(void*)
(/opt/wandbox/clang-head/bin/clang+++0x19f9454)
#1 0x00000000019f9726 SignalHandler(int)
(/opt/wandbox/clang-head/bin/clang+++0x19f9726)
#2 0x00007f3e34096390 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x11390)
#3 0x0000000001626c0a llvm::FunctionType::get(llvm::Type*,
llvm::ArrayRef<llvm::Type*>, bool)
(/opt/wandbox/clang-head/bin/clang+++0x1626c0a)
#4 0x0000000001c83e97
clang::CodeGen::CodeGenTypes::GetFunctionType(clang::CodeGen::CGFunctionInfo
const&) (/opt/wandbox/clang-head/bin/clang+++0x1c83e97)
#5 0x0000000001c127d4
clang::CodeGen::CodeGenTypes::ConvertFunctionType(clang::QualType,
clang::FunctionDecl const*) (/opt/wandbox/clang-head/bin/clang+++0x1c127d4)
#6 0x0000000001c10df0
clang::CodeGen::CodeGenTypes::ConvertType(clang::QualType)
(/opt/wandbox/clang-head/bin/clang+++0x1c10df0)
#7 0x0000000001c10be0
clang::CodeGen::CodeGenTypes::ConvertTypeForMem(clang::QualType)
(/opt/wandbox/clang-head/bin/clang+++0x1c10be0)
#8 0x0000000001bc9a51
clang::CodeGen::CodeGenModule::EmitAliasDefinition(clang::GlobalDecl)
(/opt/wandbox/clang-head/bin/clang+++0x1bc9a51)
#9 0x0000000001bccaf6
clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*)
(/opt/wandbox/clang-head/bin/clang+++0x1bccaf6)
#10 0x00000000021c2d8f (anonymous
namespace)::CodeGeneratorImpl::HandleTopLevelDecl(clang::DeclGroupRef)
(/opt/wandbox/clang-head/bin/clang+++0x21c2d8f)
#11 0x00000000021c0553
clang::BackendConsumer::HandleTopLevelDecl(clang::DeclGroupRef)
(/opt/wandbox/clang-head/bin/clang+++0x21c0553)
#12 0x000000000264bc74 clang::ParseAST(clang::Sema&, bool, bool)
(/opt/wandbox/clang-head/bin/clang+++0x264bc74)
#13 0x0000000001ed7f0f clang::FrontendAction::Execute()
(/opt/wandbox/clang-head/bin/clang+++0x1ed7f0f)
#14 0x0000000001e99ab8
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/opt/wandbox/clang-head/bin/clang+++0x1e99ab8)
#15 0x0000000001f610ee
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/opt/wandbox/clang-head/bin/clang+++0x1f610ee)
#16 0x0000000000851ff2 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/opt/wandbox/clang-head/bin/clang+++0x851ff2)
#17 0x0000000000850f18 main (/opt/wandbox/clang-head/bin/clang+++0x850f18)
#18 0x00007f3e32e05830 __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x20830)
#19 0x000000000084de79 _start (/opt/wandbox/clang-head/bin/clang+++0x84de79)
Stack dump:
0. Program arguments: /opt/wandbox/clang-head/bin/clang++ -cc1 -triple
x86_64-unknown-linux-gnu -emit-llvm -o /dev/null -x c++ -std=c++14 -
1. <eof> parser at end of file
2. <stdin>:2:6: LLVM IR generation of declaration 'f'
### EXPECTED OUTPUT:
(clean compile)
### COMPILER VERSION INFO (clang++ -v):
clang version 6.0.0 (<a href="https://github.com/llvm-mirror/clang.git">https://github.com/llvm-mirror/clang.git</a>
7617352ce7f8b221d531dce1f95f2ee78e57cfac)
(<a href="https://github.com/llvm-mirror/llvm.git">https://github.com/llvm-mirror/llvm.git</a>
38e69b8dcf7aa24ceaf101ea2cde4d1f8f47ecb0)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /opt/wandbox/clang-head/bin
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.4.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6.0.0
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.4.0
Candidate multilib: .;@m64
Selected multilib: .;@m64</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>