[llvm-bugs] [Bug 33988] New: ICE with alias attribute and placeholder for return type deduction

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Jul 29 12:32:22 PDT 2017


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

            Bug ID: 33988
           Summary: ICE with alias attribute and placeholder for return
                    type deduction
           Product: clang
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++14
          Assignee: unassignedclangbugs at nondot.org
          Reporter: hstong at ca.ibm.com
                CC: llvm-bugs at lists.llvm.org

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 (https://github.com/llvm-mirror/clang.git
7617352ce7f8b221d531dce1f95f2ee78e57cfac)
(https://github.com/llvm-mirror/llvm.git
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

-- 
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/20170729/820e61bd/attachment.html>


More information about the llvm-bugs mailing list