<p dir="ltr"><br>
On 7 Sep 2013 02:39, "David Majnemer" <<a href="mailto:david.majnemer@gmail.com">david.majnemer@gmail.com</a>> wrote:<br>
><br>
> Hi rsmith, rjmccall, eli.friedman, doug.gregor,<br>
><br>
> We would previously treat nullptr literals as we were mangling the for<br>
> the null pointer value of the template parameter's type instead.<br>
><br>
> This fixes PR17141.<br>
><br>
> <a href="http://llvm-reviews.chandlerc.com/D1625">http://llvm-reviews.chandlerc.com/D1625</a><br>
><br>
> Files:<br>
>   lib/AST/ItaniumMangle.cpp<br>
>   test/CodeGenCXX/mangle-nullptr-arg.cpp<br>
>   test/CodeGenCXX/visibility.cpp<br>
><br>
> Index: lib/AST/ItaniumMangle.cpp<br>
> ===================================================================<br>
> --- lib/AST/ItaniumMangle.cpp<br>
> +++ lib/AST/ItaniumMangle.cpp<br>
> @@ -3337,10 +3337,8 @@<br>
>      break;<br>
>    }<br>
>    case TemplateArgument::NullPtr: {<br>
> -    //  <expr-primary> ::= L <type> 0 E<br>
> -    Out << 'L';<br>
> -    mangleType(A.getNullPtrType());<br>
> -    Out << "0E";<br>
> +    //  <expr-primary> ::= L <nullptr type> E<br>
> +    Out << "LDnE";<br>
>      break;<br>
>    }<br>
>    case TemplateArgument::Pack: {<br>
> Index: test/CodeGenCXX/mangle-nullptr-arg.cpp<br>
> ===================================================================<br>
> --- test/CodeGenCXX/mangle-nullptr-arg.cpp<br>
> +++ test/CodeGenCXX/mangle-nullptr-arg.cpp<br>
> @@ -2,15 +2,15 @@<br>
><br>
>  template<int *ip> struct IP {};<br>
><br>
> -// CHECK-LABEL: define void @_Z5test12IPILPi0EE<br>
> +// CHECK-LABEL: define void @_Z5test12IPILDnEE<br>
>  void test1(IP<nullptr>) {}</p>
<p dir="ltr">The old mangling was correct here.</p>
<p dir="ltr">>  struct X{ };<br>
>  template<int X::*pm> struct PM {};<br>
><br>
> -// CHECK-LABEL: define void @_Z5test22PMILM1Xi0EE<br>
> +// CHECK-LABEL: define void @_Z5test22PMILDnEE<br>
>  void test2(PM<nullptr>) { }</p>
<p dir="ltr">And here. You should only change the mangling of a null pointer of type std::nullptr_t.</p>
<p dir="ltr">Also, maybe this ABI break should be listed in the release notes. Does GCC implement this rule yet?</p>
<p dir="ltr">> -// CHECK-LABEL: define void @_Z5test316DependentTypePtrIPiLS0_0EE<br>
> +// CHECK-LABEL: define void @_Z5test316DependentTypePtrIPiLDnEE<br>
>  template<typename T, T x> struct DependentTypePtr {};<br>
>  void test3(DependentTypePtr<int*,nullptr>) { }<br>
> Index: test/CodeGenCXX/visibility.cpp<br>
> ===================================================================<br>
> --- test/CodeGenCXX/visibility.cpp<br>
> +++ test/CodeGenCXX/visibility.cpp<br>
> @@ -971,8 +971,8 @@<br>
>    void f() {<br>
>      zed<nullptr>();<br>
>    }<br>
> -  // CHECK-LABEL: define internal void @_ZN6test523zedILPNS_12_GLOBAL__N_13fooE0EEEvv<br>
> -  // CHECK-HIDDEN-LABEL: define internal void @_ZN6test523zedILPNS_12_GLOBAL__N_13fooE0EEEvv<br>
> +  // CHECK-LABEL: define internal void @_ZN6test523zedILDnEEEvv<br>
> +  // CHECK-HIDDEN-LABEL: define internal void @_ZN6test523zedILDnEEEvv<br>
>  }<br>
><br>
>  namespace test53 {<br>
</p>