http://llvm.org/bugs/show_bug.cgi?id=17152

            Bug ID: 17152
           Summary: [-cxx-abi microsoft] Mangle local types more
                    accurately
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

consider:
template <class T> struct A {
    // in A<X>, the following is allowed because the type with no linkage
    // X is named using template parameter T.
    friend void f(A, T){}
};

template <class T> int *g(T t) {
  static int x = 0;
    A<T> at;
    f(at, t);
    return &x;
}

int main() {
    class X {} x;
    return *g(x);
}

we mangle:
?f@@YAXU?$A@VX@?1??main@@@@@VX@?1??main@@@@Z
?x@?1???$g@VX@?1??main@@@@@YAPEAHVX@?1??main@@@@Z@4HA

we want:
?f@@YAXU?$A@VX@?1?main@@@VX@?1??main@@9@@Z
?x@?1???$g@VX@?1?main@@@YAPEAHVX@?1??main@@9@@Z@4HA

-- 
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