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: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]


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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to