From e3852fa4052cef4715acebcffe2e18e2ff8b76b8 Mon Sep 17 00:00:00 2001 From: Tamas Berghammer Date: Wed, 24 May 2017 11:29:02 +0000 Subject: [PATCH] Demangler: Fix constructor cv qualifier handling Previously if we parsed a constructor then we set parsed_ctor_dtor_cv to true and never reseted it. This causes issue when a template argument references a constructor (e.g. type of lambda defined inside a constructor) as we will have the parsed_ctor_dtor_cv flag set what will cause issues when parsing later arguments. Differential Revision: https://reviews.llvm.org/D33385 libcxxabi change: https://reviews.llvm.org/rL303737 llvm-svn: 303738 --- llvm/lib/Demangle/ItaniumDemangle.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/llvm/lib/Demangle/ItaniumDemangle.cpp b/llvm/lib/Demangle/ItaniumDemangle.cpp index f454ae61d965..d6e76e49c0f5 100644 --- a/llvm/lib/Demangle/ItaniumDemangle.cpp +++ b/llvm/lib/Demangle/ItaniumDemangle.cpp @@ -4030,6 +4030,8 @@ static const char *parse_encoding(const char *first, const char *last, C &db) { save_value sb(db.tag_templates); if (db.encoding_depth > 1) db.tag_templates = true; + save_value sp(db.parsed_ctor_dtor_cv); + db.parsed_ctor_dtor_cv = false; switch (*first) { case 'G': case 'T':