[PATCH] D15005: Fix PR8170: Clang does not check constructor declaration that uses a template-id

Faisal Vali via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 7 14:58:16 PST 2015


faisalv added inline comments.

================
Comment at: lib/Sema/SemaTemplate.cpp:528
@@ +527,3 @@
+                [&StringifiedTemplateArgs, this](const TemplateArgument &TA) {
+    if (const bool IsFirst = !StringifiedTemplateArgs.size())
+      StringifiedTemplateArgs = "<";
----------------
majnemer wrote:
> You could use `StringifiedTemplateArgs.empty()` instead.
Aah yes - Will do - Thanks!

================
Comment at: lib/Sema/SemaTemplate.cpp:529
@@ +528,3 @@
+    if (const bool IsFirst = !StringifiedTemplateArgs.size())
+      StringifiedTemplateArgs = "<";
+    else
----------------
majnemer wrote:
> You could hoist this bit out of the `std::for_each`
Well - I would still need some way to know that this is not the first iteration.  I was trying to avoid declaring another variable or checking that the string was equal to another string (I thought the empty check would be reasonable) -do you feel strongly about the hoist?


http://reviews.llvm.org/D15005





More information about the cfe-commits mailing list