[PATCH] D60386: FileCheck [6/12]: Introduce numeric variable definition

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 23 08:30:45 PDT 2019


jhenderson added inline comments.


================
Comment at: llvm/include/llvm/Support/FileCheck.h:355
 public:
   explicit FileCheckPattern(Check::FileCheckType Ty,
+                            FileCheckPatternContext *Context, unsigned Line)
----------------
probinson wrote:
> jhenderson wrote:
> > probinson wrote:
> > > Multiple parameters means you don't need 'explicit'.
> > There's still an explicit here (but it's worth noting that `explicit` does still have an effect on multi-parameter constructor).
> Really? What effect does `explicit` have on a multi-parameter constructor? My reading of the cppreference.org description is that it used to apply to `T var = {args};` but that is list-initialization starting with C++11.
The example on https://en.cppreference.com/w/cpp/language/explicit, shows that copy-list-initialization does not consider conversion constructors marked with `explicit`, from C++11. Take a look at the A3, A4, B3 and B4 examples. Summary version is that `A var = {arg1, arg2};` will match a constructor without explicit, but not one with, whilst `A var {arg1, arg2};` will work for both.

Mind you, it's not likely to actually matter in most instances, and we may not actually want the behaviour of `explicit`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D60386





More information about the llvm-commits mailing list