[PATCH] D60387: FileCheck [7/12]: Arbitrary long numeric expressions

Thomas Preud'homme via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 12 08:05:04 PDT 2019


thopre marked 2 inline comments as done.
thopre added inline comments.


================
Comment at: llvm/lib/Support/FileCheck.cpp:108
+  VariableProperties VarProperties = {Name, IsPseudo};
+  return VarProperties;
 }
----------------
jhenderson wrote:
> You might be able to just do `return {Name, IsPseudo}` to avoid the temporary.
I tried but it didn't work. I think it would if I was returning the structure, but here I'm returning an Expected.

As per 6.6.3 C++11 draft:
"A return statement with a braced-init-list initializes the object or reference to be returned from the function by copy-list-initialization (8.5.4) from the specified initializer list."

So it tries to build an Expected with that initialization list which fails because I think an Expected<foo> only accepts a Foo.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D60387





More information about the llvm-commits mailing list