[lld] r302273 - Remove redundant `explicit`.

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Mon May 8 10:22:59 PDT 2017


Weirdly/pedantically, 'explicit' on a multi-arg ctor is actually
meaningful. It stops {x, y, z} from compiling for the type (eg:
LazyObjectFile func() { return {x, y, z}; } could compile if the ctor was
not explicit, but would fail to compile if the ctor was explicit)

LLVM (& Google too, FWIW) don't apply explicit to every ctor that might be
weird/confusing if it were called with {x, y, z} - so, yeah, probably good
to remove for consistency - but just figured I'd mention it.

On Fri, May 5, 2017 at 12:38 PM Rui Ueyama via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> Author: ruiu
> Date: Fri May  5 14:24:58 2017
> New Revision: 302273
>
> URL: http://llvm.org/viewvc/llvm-project?rev=302273&view=rev
> Log:
> Remove redundant `explicit`.
>
> Modified:
>     lld/trunk/ELF/InputFiles.h
>
> Modified: lld/trunk/ELF/InputFiles.h
> URL:
> http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputFiles.h?rev=302273&r1=302272&r2=302273&view=diff
>
> ==============================================================================
> --- lld/trunk/ELF/InputFiles.h (original)
> +++ lld/trunk/ELF/InputFiles.h Fri May  5 14:24:58 2017
> @@ -219,8 +219,8 @@ private:
>  // archive file semantics.
>  class LazyObjectFile : public InputFile {
>  public:
> -  explicit LazyObjectFile(MemoryBufferRef M, StringRef ArchiveName,
> -                          uint64_t OffsetInArchive)
> +  LazyObjectFile(MemoryBufferRef M, StringRef ArchiveName,
> +                 uint64_t OffsetInArchive)
>        : InputFile(LazyObjectKind, M), OffsetInArchive(OffsetInArchive) {
>      this->ArchiveName = ArchiveName;
>    }
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170508/cfa1de16/attachment.html>


More information about the llvm-commits mailing list