[PATCH] D27094: [StringRef] Use default member initializers and = default.

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 28 09:51:48 PST 2016


Any particular reason for the change?

But *shrug* looks good to me, in any case.

On Thu, Nov 24, 2016 at 4:34 AM Malcolm Parsons via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> malcolm.parsons updated this revision to Diff 79216.
> malcolm.parsons added a comment.
>
> Upload the correct patch.
>
>
> https://reviews.llvm.org/D27094
>
> Files:
>   include/llvm/ADT/StringRef.h
>
>
> Index: include/llvm/ADT/StringRef.h
> ===================================================================
> --- include/llvm/ADT/StringRef.h
> +++ include/llvm/ADT/StringRef.h
> @@ -53,10 +53,10 @@
>
>    private:
>      /// The start of the string, in an external buffer.
> -    const char *Data;
> +    const char *Data = nullptr;
>
>      /// The length of the string.
> -    size_t Length;
> +    size_t Length = 0;
>
>      // Workaround memcmp issue with null pointers (undefined behavior)
>      // by providing a specialized version
> @@ -71,7 +71,7 @@
>      /// @{
>
>      /// Construct an empty string ref.
> -    /*implicit*/ StringRef() : Data(nullptr), Length(0) {}
> +    /*implicit*/ StringRef() = default;
>
>      /// Disable conversion from nullptr.  This prevents things like
>      /// if (S == nullptr)
>
>
> _______________________________________________
> 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/20161128/31da429c/attachment.html>


More information about the llvm-commits mailing list