Skip to content

Commit 4c5650f

Browse files
Abseil Teamcopybara-github
authored andcommitted
Add NOLINT to address modernize-use-trailing-return-type in TEST_F uses
Example command: ``` clang_tidy '--config={Checks: "modernize-use-trailing-return-type"}' googletest-death-test-test.cc ``` Example error: ``` warning: use a trailing return type for this function [modernize-use-trailing-return-type] TEST(NotADeathTest, Test) { ^ ``` PiperOrigin-RevId: 414836261 Change-Id: I5f758423667559abfbf313190543666bc4ce0e6e
1 parent d61d4d8 commit 4c5650f

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

googletest/include/gtest/internal/gtest-port.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -689,25 +689,29 @@ typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION;
689689

690690
// A macro to disallow copy operator=
691691
// This should be used in the private: declarations for a class.
692+
// NOLINT is for modernize-use-trailing-return-type in macro uses.
692693
#define GTEST_DISALLOW_ASSIGN_(type) \
693-
type& operator=(type const &) = delete
694+
type& operator=(type const&) = delete /* NOLINT */
694695

695696
// A macro to disallow copy constructor and operator=
696697
// This should be used in the private: declarations for a class.
698+
// NOLINT is for modernize-use-trailing-return-type in macro uses.
697699
#define GTEST_DISALLOW_COPY_AND_ASSIGN_(type) \
698700
type(type const&) = delete; \
699-
type& operator=(type const&) = delete
701+
type& operator=(type const&) = delete /* NOLINT */
700702

701703
// A macro to disallow move operator=
702704
// This should be used in the private: declarations for a class.
705+
// NOLINT is for modernize-use-trailing-return-type in macro uses.
703706
#define GTEST_DISALLOW_MOVE_ASSIGN_(type) \
704-
type& operator=(type &&) noexcept = delete
707+
type& operator=(type&&) noexcept = delete /* NOLINT */
705708

706709
// A macro to disallow move constructor and operator=
707710
// This should be used in the private: declarations for a class.
711+
// NOLINT is for modernize-use-trailing-return-type in macro uses.
708712
#define GTEST_DISALLOW_MOVE_AND_ASSIGN_(type) \
709713
type(type&&) noexcept = delete; \
710-
type& operator=(type&&) noexcept = delete
714+
type& operator=(type&&) noexcept = delete /* NOLINT */
711715

712716
// Tell the compiler to warn about unused return values for functions declared
713717
// with this macro. The macro should be used on function declarations

0 commit comments

Comments
 (0)