[PATCH] D77741: [FileCheck] Better diagnostic for format conflict

Thomas Preud'homme via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 9 01:03:46 PDT 2020


thopre marked an inline comment as done.
thopre added inline comments.


================
Comment at: llvm/lib/Support/FileCheck.cpp:434
     Format = ExplicitFormat;
-  else if (ImplicitFormat == ExpressionFormat::Kind::Conflict)
-    return ErrorDiagnostic::get(
-        SM, UseExpr,
-        "variables with conflicting format specifier: need an explicit one");
-  else if (bool(ImplicitFormat))
-    Format = ImplicitFormat;
-  else
+  else if (ExpressionASTPointer) {
+    Expected<ExpressionFormat> ImplicitFormat =
----------------
jdenny wrote:
> Is there a logic change here for the case of !ExpressionASTPointer?
> 
> That used to mean ImplicitFormat = NoFormat and then Format = ImplicitFormat.
> 
> Now it means Format = Unsigned.
> 
> Did I read that correctly?  Why the change?
My bad, forgot to submit to send this reply:

NoFormat evaluates to false, hence the final else would have applied instead and set Format to Unsigned. Therefore the behavior is unchanged.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77741





More information about the llvm-commits mailing list