diff options
author | Kitware Robot <kwrobot@kitware.com> | 2018-06-01 13:53:41 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-06-01 13:53:42 (GMT) |
commit | d7204e649ed4ebb19bb341b4e49eb51514364922 (patch) | |
tree | d9ac3ded5ae6899be7188795011743fe3e6da0a6 /Tests/CompileFeatures | |
parent | 12fed3edb107c949671043196fa94c542b45452a (diff) | |
download | CMake-d7204e649ed4ebb19bb341b4e49eb51514364922.zip CMake-d7204e649ed4ebb19bb341b4e49eb51514364922.tar.gz CMake-d7204e649ed4ebb19bb341b4e49eb51514364922.tar.bz2 |
Revise C++ coding style using clang-format-6.0
Run the `clang-format.bash` script to update all our C and C++ code to a
new style defined by `.clang-format`. Use `clang-format` version 6.0.
* If you reached this commit for a line in `git blame`, re-run the blame
operation starting at the parent of this commit to see older history
for the content.
* See the parent commit for instructions to rebase a change across this
style transition commit.
Diffstat (limited to 'Tests/CompileFeatures')
-rw-r--r-- | Tests/CompileFeatures/cxx_attribute_deprecated.cpp | 5 | ||||
-rw-r--r-- | Tests/CompileFeatures/cxx_contextual_conversions.cpp | 1 | ||||
-rw-r--r-- | Tests/CompileFeatures/cxx_generalized_initializers.cpp | 2 | ||||
-rw-r--r-- | Tests/CompileFeatures/cxx_lambda_init_captures.cpp | 3 | ||||
-rw-r--r-- | Tests/CompileFeatures/cxx_variadic_templates.cpp | 2 | ||||
-rw-r--r-- | Tests/CompileFeatures/default_dialect.c | 26 | ||||
-rw-r--r-- | Tests/CompileFeatures/default_dialect.cpp | 31 | ||||
-rw-r--r-- | Tests/CompileFeatures/genex_test.c | 42 | ||||
-rw-r--r-- | Tests/CompileFeatures/genex_test.cpp | 76 |
9 files changed, 93 insertions, 95 deletions
diff --git a/Tests/CompileFeatures/cxx_attribute_deprecated.cpp b/Tests/CompileFeatures/cxx_attribute_deprecated.cpp index 5482db8..8faeca8 100644 --- a/Tests/CompileFeatures/cxx_attribute_deprecated.cpp +++ b/Tests/CompileFeatures/cxx_attribute_deprecated.cpp @@ -1,8 +1,5 @@ -[[deprecated]] int foo() -{ - return 0; -} +[[deprecated]] int foo() { return 0; } int someFunc() { diff --git a/Tests/CompileFeatures/cxx_contextual_conversions.cpp b/Tests/CompileFeatures/cxx_contextual_conversions.cpp index cbc7304..247f13f 100644 --- a/Tests/CompileFeatures/cxx_contextual_conversions.cpp +++ b/Tests/CompileFeatures/cxx_contextual_conversions.cpp @@ -17,6 +17,7 @@ public: } operator T&() { return val; } operator T() const { return val; } + private: T val; }; diff --git a/Tests/CompileFeatures/cxx_generalized_initializers.cpp b/Tests/CompileFeatures/cxx_generalized_initializers.cpp index 0df0a33..bfe0d41 100644 --- a/Tests/CompileFeatures/cxx_generalized_initializers.cpp +++ b/Tests/CompileFeatures/cxx_generalized_initializers.cpp @@ -1,5 +1,5 @@ #if defined(_MSC_VER) && _MSC_VER == 1800 && _MSC_FULL_VER < 180030723 -#error "VS 2013 safely supports this only with Update 3 or greater" +# error "VS 2013 safely supports this only with Update 3 or greater" #endif // Dummy implementation. Test only the compiler feature. diff --git a/Tests/CompileFeatures/cxx_lambda_init_captures.cpp b/Tests/CompileFeatures/cxx_lambda_init_captures.cpp index 46f22cb..7e337fa 100644 --- a/Tests/CompileFeatures/cxx_lambda_init_captures.cpp +++ b/Tests/CompileFeatures/cxx_lambda_init_captures.cpp @@ -2,6 +2,5 @@ int someFunc() { int a = 0; - return [b = static_cast<int&&>(a)]() { return b; } - (); + return [b = static_cast<int&&>(a)]() { return b; }(); } diff --git a/Tests/CompileFeatures/cxx_variadic_templates.cpp b/Tests/CompileFeatures/cxx_variadic_templates.cpp index 6951230..627b8d9 100644 --- a/Tests/CompileFeatures/cxx_variadic_templates.cpp +++ b/Tests/CompileFeatures/cxx_variadic_templates.cpp @@ -1,5 +1,5 @@ #if defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) < 407) -#define OLD_GNU +# define OLD_GNU #endif #ifdef OLD_GNU diff --git a/Tests/CompileFeatures/default_dialect.c b/Tests/CompileFeatures/default_dialect.c index 2b4627c..6160c2f 100644 --- a/Tests/CompileFeatures/default_dialect.c +++ b/Tests/CompileFeatures/default_dialect.c @@ -1,20 +1,20 @@ #if DEFAULT_C11 -#if __STDC_VERSION__ < 201112L -#error Unexpected value for __STDC_VERSION__. -#endif +# if __STDC_VERSION__ < 201112L +# error Unexpected value for __STDC_VERSION__. +# endif #elif DEFAULT_C99 -#if __STDC_VERSION__ != 199901L -#error Unexpected value for __STDC_VERSION__. -#endif +# if __STDC_VERSION__ != 199901L +# error Unexpected value for __STDC_VERSION__. +# endif #else -#if !DEFAULT_C90 -#error Buildsystem error -#endif -#if defined(__STDC_VERSION__) && \ - !(defined(__SUNPRO_C) && __STDC_VERSION__ == 199409L) -#error Unexpected __STDC_VERSION__ definition -#endif +# if !DEFAULT_C90 +# error Buildsystem error +# endif +# if defined(__STDC_VERSION__) && \ + !(defined(__SUNPRO_C) && __STDC_VERSION__ == 199409L) +# error Unexpected __STDC_VERSION__ definition +# endif #endif int main() diff --git a/Tests/CompileFeatures/default_dialect.cpp b/Tests/CompileFeatures/default_dialect.cpp index 7ddcfe7..3ee60a6 100644 --- a/Tests/CompileFeatures/default_dialect.cpp +++ b/Tests/CompileFeatures/default_dialect.cpp @@ -3,34 +3,35 @@ template <long l> struct Outputter; #if defined(_MSC_VER) && defined(_MSVC_LANG) -#define CXX_STD _MSVC_LANG +# define CXX_STD _MSVC_LANG #else -#define CXX_STD __cplusplus +# define CXX_STD __cplusplus #endif #if DEFAULT_CXX20 -#if CXX_STD <= 201703L +# if CXX_STD <= 201703L Outputter<CXX_STD> o; -#endif +# endif #elif DEFAULT_CXX17 -#if CXX_STD <= 201402L +# if CXX_STD <= 201402L Outputter<CXX_STD> o; -#endif +# endif #elif DEFAULT_CXX14 -#if CXX_STD != 201402L +# if CXX_STD != 201402L Outputter<CXX_STD> o; -#endif +# endif #elif DEFAULT_CXX11 -#if CXX_STD != 201103L +# if CXX_STD != 201103L Outputter<CXX_STD> o; -#endif +# endif #else -#if !DEFAULT_CXX98 -#error Buildsystem error -#endif -#if CXX_STD != 199711L && CXX_STD != 1 && !defined(__GXX_EXPERIMENTAL_CXX0X__) +# if !DEFAULT_CXX98 +# error Buildsystem error +# endif +# if CXX_STD != 199711L && CXX_STD != 1 && \ + !defined(__GXX_EXPERIMENTAL_CXX0X__) Outputter<CXX_STD> o; -#endif +# endif #endif int main() diff --git a/Tests/CompileFeatures/genex_test.c b/Tests/CompileFeatures/genex_test.c index e58d793..de408ce 100644 --- a/Tests/CompileFeatures/genex_test.c +++ b/Tests/CompileFeatures/genex_test.c @@ -1,41 +1,41 @@ #ifndef EXPECT_C_STATIC_ASSERT -#error EXPECT_C_STATIC_ASSERT not defined +# error EXPECT_C_STATIC_ASSERT not defined #endif #ifndef EXPECT_C_FUNCTION_PROTOTYPES -#error EXPECT_C_FUNCTION_PROTOTYPES not defined +# error EXPECT_C_FUNCTION_PROTOTYPES not defined #endif #ifndef EXPECT_C_RESTRICT -#error EXPECT_C_RESTRICT not defined +# error EXPECT_C_RESTRICT not defined #endif #if !HAVE_C_STATIC_ASSERT -#if EXPECT_C_STATIC_ASSERT -#error "Expect c_static_assert feature" -#endif +# if EXPECT_C_STATIC_ASSERT +# error "Expect c_static_assert feature" +# endif #else -#if !EXPECT_C_STATIC_ASSERT -#error "Expect no c_static_assert feature" -#endif +# if !EXPECT_C_STATIC_ASSERT +# error "Expect no c_static_assert feature" +# endif #endif #if !HAVE_C_FUNCTION_PROTOTYPES -#if EXPECT_C_FUNCTION_PROTOTYPES -#error Expect c_function_prototypes support -#endif +# if EXPECT_C_FUNCTION_PROTOTYPES +# error Expect c_function_prototypes support +# endif #else -#if !EXPECT_C_FUNCTION_PROTOTYPES -#error Expect no c_function_prototypes support -#endif +# if !EXPECT_C_FUNCTION_PROTOTYPES +# error Expect no c_function_prototypes support +# endif #endif #if !HAVE_C_RESTRICT -#if EXPECT_C_RESTRICT -#error Expect c_restrict support -#endif +# if EXPECT_C_RESTRICT +# error Expect c_restrict support +# endif #else -#if !EXPECT_C_RESTRICT -#error Expect no c_restrict support -#endif +# if !EXPECT_C_RESTRICT +# error Expect no c_restrict support +# endif #endif int main() diff --git a/Tests/CompileFeatures/genex_test.cpp b/Tests/CompileFeatures/genex_test.cpp index 5303e73..59f9006 100644 --- a/Tests/CompileFeatures/genex_test.cpp +++ b/Tests/CompileFeatures/genex_test.cpp @@ -1,36 +1,36 @@ #ifndef EXPECT_FINAL -#error EXPECT_FINAL not defined +# error EXPECT_FINAL not defined #endif #ifndef EXPECT_INHERITING_CONSTRUCTORS -#error EXPECT_INHERITING_CONSTRUCTORS not defined +# error EXPECT_INHERITING_CONSTRUCTORS not defined #endif #ifndef EXPECT_INHERITING_CONSTRUCTORS_AND_FINAL -#error EXPECT_INHERITING_CONSTRUCTORS_AND_FINAL not defined +# error EXPECT_INHERITING_CONSTRUCTORS_AND_FINAL not defined #endif #ifndef EXPECT_OVERRIDE_CONTROL -#error EXPECT_OVERRIDE_CONTROL not defined +# error EXPECT_OVERRIDE_CONTROL not defined #endif #ifdef TEST_CXX_STD -#if !HAVE_CXX_STD_11 -#error HAVE_CXX_STD_11 is false with CXX_STANDARD == 11 -#endif -#if HAVE_CXX_STD_14 -#error HAVE_CXX_STD_14 is true with CXX_STANDARD == 11 -#endif -#if HAVE_CXX_STD_17 -#error HAVE_CXX_STD_17 is true with CXX_STANDARD == 11 -#endif +# if !HAVE_CXX_STD_11 +# error HAVE_CXX_STD_11 is false with CXX_STANDARD == 11 +# endif +# if HAVE_CXX_STD_14 +# error HAVE_CXX_STD_14 is true with CXX_STANDARD == 11 +# endif +# if HAVE_CXX_STD_17 +# error HAVE_CXX_STD_17 is true with CXX_STANDARD == 11 +# endif #endif #if !HAVE_OVERRIDE_CONTROL -#if EXPECT_OVERRIDE_CONTROL -#error "Expect override control feature" -#endif +# if EXPECT_OVERRIDE_CONTROL +# error "Expect override control feature" +# endif #else -#if !EXPECT_OVERRIDE_CONTROL -#error "Expect no override control feature" -#endif +# if !EXPECT_OVERRIDE_CONTROL +# error "Expect no override control feature" +# endif struct A { @@ -45,37 +45,37 @@ struct B final : A #endif #if !HAVE_AUTO_TYPE -#error Expect cxx_auto_type support +# error Expect cxx_auto_type support #endif #if !HAVE_INHERITING_CONSTRUCTORS -#if EXPECT_INHERITING_CONSTRUCTORS -#error Expect cxx_inheriting_constructors support -#endif +# if EXPECT_INHERITING_CONSTRUCTORS +# error Expect cxx_inheriting_constructors support +# endif #else -#if !EXPECT_INHERITING_CONSTRUCTORS -#error Expect no cxx_inheriting_constructors support -#endif +# if !EXPECT_INHERITING_CONSTRUCTORS +# error Expect no cxx_inheriting_constructors support +# endif #endif #if !HAVE_FINAL -#if EXPECT_FINAL -#error Expect cxx_final support -#endif +# if EXPECT_FINAL +# error Expect cxx_final support +# endif #else -#if !EXPECT_FINAL -#error Expect no cxx_final support -#endif +# if !EXPECT_FINAL +# error Expect no cxx_final support +# endif #endif #if !HAVE_INHERITING_CONSTRUCTORS_AND_FINAL -#if EXPECT_INHERITING_CONSTRUCTORS_AND_FINAL -#error Expect cxx_inheriting_constructors and cxx_final support -#endif +# if EXPECT_INHERITING_CONSTRUCTORS_AND_FINAL +# error Expect cxx_inheriting_constructors and cxx_final support +# endif #else -#if !EXPECT_INHERITING_CONSTRUCTORS_AND_FINAL -#error Expect no combined cxx_inheriting_constructors and cxx_final support -#endif +# if !EXPECT_INHERITING_CONSTRUCTORS_AND_FINAL +# error Expect no combined cxx_inheriting_constructors and cxx_final support +# endif #endif int main() |