]> granicus.if.org Git - clang/commitdiff
Fix PR30440: Initialize FunctionTypeDepth in CXXNameMangler
authorAlex Lorenz <arphaman@gmail.com>
Thu, 6 Oct 2016 09:37:15 +0000 (09:37 +0000)
committerAlex Lorenz <arphaman@gmail.com>
Thu, 6 Oct 2016 09:37:15 +0000 (09:37 +0000)
This commit fixes PR 30440 by initializing CXXNameMangler's FunctionTypeDepth
in the two constructors added in r274222 (The commit that caused this
regression).

rdar://28455269

Differential Revision: https://reviews.llvm.org/D24932

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@283428 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/ItaniumMangle.cpp
test/CodeGenCXX/mangle-abi-tag.cpp

index 95d8af96485b96bebd82a6a3647c04b8876a331c..db0df363c0cc1f6eda9a0ee11ce4ff8add177f5f 100644 (file)
@@ -405,14 +405,14 @@ public:
   CXXNameMangler(CXXNameMangler &Outer, raw_ostream &Out_)
       : Context(Outer.Context), Out(Out_), NullOut(false),
         Structor(Outer.Structor), StructorType(Outer.StructorType),
-        SeqID(Outer.SeqID), AbiTagsRoot(AbiTags),
-        Substitutions(Outer.Substitutions) {}
+        SeqID(Outer.SeqID), FunctionTypeDepth(Outer.FunctionTypeDepth),
+        AbiTagsRoot(AbiTags), Substitutions(Outer.Substitutions) {}
 
   CXXNameMangler(CXXNameMangler &Outer, llvm::raw_null_ostream &Out_)
       : Context(Outer.Context), Out(Out_), NullOut(true),
         Structor(Outer.Structor), StructorType(Outer.StructorType),
-        SeqID(Outer.SeqID), AbiTagsRoot(AbiTags),
-        Substitutions(Outer.Substitutions) {}
+        SeqID(Outer.SeqID), FunctionTypeDepth(Outer.FunctionTypeDepth),
+        AbiTagsRoot(AbiTags), Substitutions(Outer.Substitutions) {}
 
 #if MANGLE_CHECKER
   ~CXXNameMangler() {
index 990d2f94b5a5782fd5b9fa7144f7ede36511f6d4..a653ff42228a50861ec3867e392bf2c6c57ba2bd 100644 (file)
@@ -219,3 +219,16 @@ void f19_test(N19::C<N19::A,  &N19::foo>, N19::F, N19::D) {
 }
 // f19_test(N19::C<N19::A, &N19::foo[abi:B]>, N19::F, N19::D)
 // CHECK-DAG: define void @_Z8f19_testN3N191CINS_1AEXadL_ZNS_3fooB1BES1_NS_1DEEEEENS_1FES2_(
+
+namespace pr30440 {
+
+template<class F> void g(F);
+template<class ...A> auto h(A ...a)->decltype (g (0, g < a > (a) ...)) {
+}
+// CHECK-DAG: define {{.*}} @_ZN7pr304401hIJEEEDTcl1gLi0Espcl1gIL_ZZNS_1hEDpT_E1aEEfp_EEES2_(
+
+void pr30440_test () {
+  h();
+}
+
+}