[PATCH] D18868: [Sema] PR27155: Fix a template argument deduction bug with base classes

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 7 15:44:22 PDT 2016


rsmith accepted this revision.
This revision is now accepted and ready to land.

================
Comment at: lib/Sema/SemaTemplateDeduction.cpp:1449-1451
@@ +1448,5 @@
+
+      const RecordType *RecordT = Arg->getAs<RecordType>();
+      if (!RecordT)
+        return Result;
+
----------------
Can you move this up and merge it with the `TDF_DerivedClass` check to also skip the copy in the case where the argument is not of class type?

================
Comment at: lib/Sema/SemaTemplateDeduction.cpp:1453-1457
@@ +1452,7 @@
+
+      // We cannot inspect base classes as part of deduction when the type
+      // is incomplete, so either instantiate any templates necessary to
+      // complete the type, or skip over it if it cannot be completed.
+      if (!S.isCompleteType(Info.getLocation(), Arg))
+        return Result;
+
----------------
... This too, if it's not too awkward.


http://reviews.llvm.org/D18868





More information about the cfe-commits mailing list