[LLVMbugs] [Bug 20517] New: Assertion failed with `decltype(auto)` and a function template with unknown return type
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Sat Aug 2 01:05:28 PDT 2014
http://llvm.org/bugs/show_bug.cgi?id=20517
Bug ID: 20517
Summary: Assertion failed with `decltype(auto)` and a function
template with unknown return type
Product: clang
Version: trunk
Hardware: PC
OS: All
Status: NEW
Severity: normal
Priority: P
Component: C++1y
Assignee: unassignedclangbugs at nondot.org
Reporter: mimomorin at gmail.com
CC: llvmbugs at cs.uiuc.edu
Classification: Unclassified
With this C++1y code:
template <typename T>
auto f(int);
int main(int argc, char* argv[])
{
decltype(auto) g = &f<int>;
return 0;
}
Clang crashes with the following message:
clang++ -std=c++1y ice_decltype_auto.cpp
ice_decltype_auto.cpp:6:24: error: reference to overloaded function could not
be
resolved; did you mean to call it?
decltype(auto) g = &f<int>;
^~~~~~~
ice_decltype_auto.cpp:2:6: note: possible target for call
auto f(int);
^
Assertion failed: (!isNull() && "Cannot retrieve a NULL type pointer"),
function getCommonPtr, file
Clang/llvm/tools/clang/lib/AST/../../include/clang/AST/Type.h, line 546.
0 clang 0x0000000104aea492 llvm::sys::PrintStackTrace(__sFILE*) + 34
Stack dump:
0. Program arguments: Clang/build/Release+Asserts/bin/clang -cc1 -triple
x86_64-apple-macosx10.7.0 -emit-obj -mrelax-all -disable-free -main-file-name
ice_decltype_auto.cpp -mrelocation-model pic -pic-level 2 -mdisable-fp-elim
-masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 136
-dwarf-column-info -resource-dir
Clang/build/Release+Asserts/bin/../lib/clang/3.6.0 -std=c++1y
-fdeprecated-macro -fdebug-compilation-dir Codes -ferror-limit 19
-fmessage-length 80 -stack-protector 1 -mstackrealign -fblocks
-fobjc-runtime=macosx-10.7.0 -fencode-extended-block-signature -fcxx-exceptions
-fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o
/var/folders/r5/h6yf9zwn68z4slg54d38smq80000gn/T/ice_decltype_auto-fa456e.o -x
c++ ice_decltype_auto.cpp
1. ice_decltype_auto.cpp:6:31: current parser token ';'
2. ice_decltype_auto.cpp:5:1: parsing function body 'main'
3. ice_decltype_auto.cpp:5:1: in compound statement ('{}')
clang: error: unable to execute command: Illegal instruction: 4
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.6.0 (trunk 214512)
Target: x86_64-apple-darwin11.4.2
Thread model: posix
clang: 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: note: diagnostic msg:
--
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/20140802/3dedde5f/attachment.html>
More information about the llvm-bugs
mailing list