[PATCH] D38320: [clang] Fix serializers for `TypeTemplateParmDecl` + related types

Alex Lorenz via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 27 15:32:25 PDT 2017


arphaman added a comment.

Hi,

Thanks for your patch! Could you please post a patch with full context (git diff -U99999)?



================
Comment at: lib/Serialization/ASTWriterDecl.cpp:1541
 
-  bool OwnsDefaultArg = D->hasDefaultArgument() &&
-                        !D->defaultArgumentWasInherited();
-  Record.push_back(OwnsDefaultArg);
-  if (OwnsDefaultArg)
-    Record.AddTypeSourceInfo(D->getDefaultArgumentInfo());
+  TypeSourceInfo *ownedDefaultArg = nullptr;
+  Decl const *inheritsFromDecl = nullptr;
----------------
Please start your variable names in uppercase (see http://llvm.org/docs/CodingStandards.html#name-types-functions-variables-and-enumerators-properly).


================
Comment at: lib/Serialization/ASTWriterDecl.cpp:1551
+
+  Record.push_back(bool(ownedDefaultArg != nullptr));
+  if (ownedDefaultArg) {
----------------
I think that cast to `bool` here and below is redundant.


Repository:
  rL LLVM

https://reviews.llvm.org/D38320





More information about the cfe-commits mailing list