Index: cfe/trunk/lib/AST/ItaniumMangle.cpp =================================================================== --- cfe/trunk/lib/AST/ItaniumMangle.cpp +++ cfe/trunk/lib/AST/ItaniumMangle.cpp @@ -4273,8 +4273,11 @@ } case Expr::GNUNullExprClass: - // FIXME: should this really be mangled the same as nullptr? - // fallthrough + // Mangle as if an integer literal 0. + Out << 'L'; + mangleType(E->getType()); + Out << "0E"; + break; case Expr::CXXNullPtrLiteralExprClass: { Out << "LDnE"; Index: cfe/trunk/test/CodeGenCXX/mangle-exprs.cpp =================================================================== --- cfe/trunk/test/CodeGenCXX/mangle-exprs.cpp +++ cfe/trunk/test/CodeGenCXX/mangle-exprs.cpp @@ -373,3 +373,19 @@ template void f(decltype(T{.a.b[3][1 ... 4] = 9}) x) {} void use_f(A a) { f(a); } } + +namespace null { + template + void cpp_nullptr(typename enable_if

::type* = 0) { + } + + template + void gnu_null(typename enable_if

::type* = 0) { + } + + // CHECK-LABEL: define {{.*}} @_ZN4null11cpp_nullptrILDn0EEEvPN9enable_ifIXeqT_LDnEEvE4typeE + template void cpp_nullptr(void *); + + // CHECK-LABEL: define {{.*}} @_ZN4null8gnu_nullILPv0EEEvPN9enable_ifIXeqT_Ll0EEvE4typeE + template void gnu_null(void *); +}