<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On 3 October 2016 at 13:12, Alex Lorenz via cfe-commits <span dir="ltr"><<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: arphaman<br>
Date: Mon Oct  3 07:12:03 2016<br>
New Revision: 283102<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=283102&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project?rev=283102&view=rev</a><br>
Log:<br>
Fix PR 28885: Fix AST Printer output for the inherited constructor using<br>
declarations.<br>
<br>
This commit ensures that the correct record type is printed out for the<br>
using declarations that represent C++ inherited constructors.<br>
It fixes a regression introduced in r274049 which changed the name that's<br>
stored in the using declarations that correspond to inherited constructors.<br>
<br>
Differential Revision: <a href="https://reviews.llvm.org/D25131" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D25131</a></blockquote><div><br></div><div>This was meant to be D25113, I'll revert and recommit.</div><div>Sorry about that,</div><div>Alex</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
Modified:<br>
    cfe/trunk/lib/AST/DeclPrinter.<wbr>cpp<br>
    cfe/trunk/test/SemaCXX/cxx11-<wbr>ast-print.cpp<br>
<br>
Modified: cfe/trunk/lib/AST/DeclPrinter.<wbr>cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclPrinter.cpp?rev=283102&r1=283101&r2=283102&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/cfe/trunk/lib/AST/<wbr>DeclPrinter.cpp?rev=283102&r1=<wbr>283101&r2=283102&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- cfe/trunk/lib/AST/DeclPrinter.<wbr>cpp (original)<br>
+++ cfe/trunk/lib/AST/DeclPrinter.<wbr>cpp Mon Oct  3 07:12:03 2016<br>
@@ -1346,6 +1346,17 @@ void DeclPrinter::VisitUsingDecl(<wbr>UsingDe<br>
   if (D->hasTypename())<br>
     Out << "typename ";<br>
   D->getQualifier()->print(Out, Policy);<br>
+<br>
+  // Use the correct record name when the using declaration is used for<br>
+  // inheriting constructors.<br>
+  for (const auto *Shadow : D->shadows()) {<br>
+    if (const auto *ConstructorShadow =<br>
+            dyn_cast<<wbr>ConstructorUsingShadowDecl>(<wbr>Shadow)) {<br>
+      assert(Shadow->getDeclContext(<wbr>) == ConstructorShadow-><wbr>getDeclContext());<br>
+      Out << *ConstructorShadow-><wbr>getNominatedBaseClass();<br>
+      return;<br>
+    }<br>
+  }<br>
   Out << *D;<br>
 }<br>
<br>
<br>
Modified: cfe/trunk/test/SemaCXX/cxx11-<wbr>ast-print.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/cxx11-ast-print.cpp?rev=283102&r1=283101&r2=283102&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/cfe/trunk/test/<wbr>SemaCXX/cxx11-ast-print.cpp?<wbr>rev=283102&r1=283101&r2=<wbr>283102&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- cfe/trunk/test/SemaCXX/cxx11-<wbr>ast-print.cpp (original)<br>
+++ cfe/trunk/test/SemaCXX/cxx11-<wbr>ast-print.cpp Mon Oct  3 07:12:03 2016<br>
@@ -43,6 +43,14 @@ template <class C, C...> const char *ope<br>
 // CHECK: const char *PR23120 = operator""_suffix<char32_t, 66615>();<br>
 const char *PR23120 = U"ð  ·"_suffix;<br>
<br>
+// PR28885<br>
+struct A {<br>
+  A();<br>
+};<br>
+struct B : A {<br>
+  using A::A; // CHECK:      using A::A;<br>
+};            // CHECK-NEXT: };<br>
+<br>
 // CHECK: ;<br>
 ;<br>
 // CHECK-NOT: ;<br>
<br>
<br>
______________________________<wbr>_________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div></div>