[PATCH] D55552: [Sema] Better static assert diagnostics for expressions involving temporaries.

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 19 07:15:48 PST 2018


aaron.ballman added inline comments.


================
Comment at: lib/AST/StmtPrinter.cpp:78
                 const PrintingPolicy &Policy, unsigned Indentation = 0,
-                StringRef NL = "\n",
-                const ASTContext *Context = nullptr)
+                StringRef NL = "\n", const ASTContext *Context = nullptr)
         : OS(os), IndentLevel(Indentation), Helper(helper), Policy(Policy),
----------------
Spurious formatting changes -- can revert this file.


================
Comment at: lib/AST/TypePrinter.cpp:165
 
+static SplitQualType splitAccordingToPolicy(QualType t,
+                                            const PrintingPolicy &Policy) {
----------------
`t` doesn't meet the usual naming requirements; how about `QT`?


================
Comment at: lib/Sema/SemaTemplate.cpp:3062
 public:
-  explicit FailedBooleanConditionPrinterHelper(const PrintingPolicy &P)
-      : Policy(P) {}
+  FailedBooleanConditionPrinterHelper(const PrintingPolicy &P) : Policy(P) {}
 
----------------
Why are you dropping the `explicit` here?


================
Comment at: lib/Sema/SemaTemplate.cpp:3124
     llvm::raw_string_ostream Out(Description);
-    FailedBooleanConditionPrinterHelper Helper(getPrintingPolicy());
-    FailedCond->printPretty(Out, &Helper, getPrintingPolicy());
+    auto Policy = getPrintingPolicy();
+    Policy.PrintCanonicalTypes = true;
----------------
Don't use `auto` here, please.


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55552/new/

https://reviews.llvm.org/D55552





More information about the cfe-commits mailing list