[LLVMbugs] [Bug 9271] New: dependent decltype in parameter of template function causes name mangling crash
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Sat Feb 19 17:28:55 PST 2011
http://llvm.org/bugs/show_bug.cgi?id=9271
Summary: dependent decltype in parameter of template function
causes name mangling crash
Product: clang
Version: unspecified
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P
Component: C++0x
AssignedTo: unassignedclangbugs at nondot.org
ReportedBy: richard-llvm at metafoo.co.uk
CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com
This code crashes in name mangling:
template<typename T> void f(T &&a, decltype(a) b);
int a;
int main() { f(a, a); }
The crash is caused by an infinite recursion: mangling the function name
f<int&> requires mangling the parameter types of the base template, and
mangling the type of b requires mangling the decltype expression, which
requires mangling a reference to f's parameter a, which erroneously requires
mangling the function name f<int&>.
The Itanium C++ ABI requires this to be mangled as:
_Z1fIRiE f<int&>
v void (
OT_ template-param-0 &&,
Dtfp_ decltype(function-param-0)
E )
It seems that clang's mangler doesn't know about the <function-param> "fp"
mangling.
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
More information about the llvm-bugs
mailing list