Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: fb151a89fb34249426ec7a56e90e7b28ec7f6f78
      
https://github.com/WebKit/WebKit/commit/fb151a89fb34249426ec7a56e90e7b28ec7f6f78
  Author: Fady Farag <[email protected]>
  Date:   2025-12-03 (Wed, 03 Dec 2025)

  Changed paths:
    M Source/WTF/wtf/StdLibExtras.h
    M Source/WTF/wtf/UniqueArray.h
    M Source/WTF/wtf/UniqueRef.h

  Log Message:
  -----------
  Add C++17 [[nodiscard]] to WTF::makeUnique and variants
https://bugs.webkit.org/show_bug.cgi?id=303439
rdar://165728567

Reviewed by Darin Adler.

libc++ marks std::make_unique's return value as [[nodiscard]].
Apply the same to WTF::makeUnique and variants to warn against
discarding return values.

LLVM/libc++ docs: 
https://libcxx.llvm.org/CodingGuidelines.html#apply-nodiscard-where-relevant

* Source/WTF/wtf/StdLibExtras.h:
(WTF::makeUnique):
(WTF::makeUniqueWithoutRefCountedCheck):
(WTF::makeUniqueWithoutFastMallocCheck):
* Source/WTF/wtf/UniqueArray.h:
(WTF::makeUniqueArray):
* Source/WTF/wtf/UniqueRef.h:
(WTF::makeUniqueRefWithoutFastMallocCheck):
(WTF::makeUniqueRefWithoutRefCountedCheck):
(WTF::makeUniqueRef):

Canonical link: https://commits.webkit.org/303848@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to