summaryrefslogtreecommitdiffstats
path: root/Tests/CompileFeatures
diff options
context:
space:
mode:
authorKitware Robot <kwrobot@kitware.com>2016-05-16 14:34:04 (GMT)
committerBrad King <brad.king@kitware.com>2016-05-16 20:05:19 (GMT)
commitd9fd2f5402eeaa345691313658e02b51038f570b (patch)
treedca71b9a7e267f4c6300da3eb770415381726785 /Tests/CompileFeatures
parent82df6deaafb36cbbfd450202bb20b320f637751a (diff)
downloadCMake-d9fd2f5402eeaa345691313658e02b51038f570b.zip
CMake-d9fd2f5402eeaa345691313658e02b51038f570b.tar.gz
CMake-d9fd2f5402eeaa345691313658e02b51038f570b.tar.bz2
Revise C++ coding style using clang-format
Run the `Utilities/Scripts/clang-format.bash` script to update all our C++ code to a new style defined by `.clang-format`. Use `clang-format` version 3.8. * 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/c_restrict.c2
-rw-r--r--Tests/CompileFeatures/cxx_aggregate_default_initializers.cpp5
-rw-r--r--Tests/CompileFeatures/cxx_alias_templates.cpp2
-rw-r--r--Tests/CompileFeatures/cxx_alignas.cpp3
-rw-r--r--Tests/CompileFeatures/cxx_attribute_deprecated.cpp3
-rw-r--r--Tests/CompileFeatures/cxx_attributes.cpp5
-rw-r--r--Tests/CompileFeatures/cxx_contextual_conversions.cpp37
-rw-r--r--Tests/CompileFeatures/cxx_decltype_incomplete_return_types.cpp17
-rw-r--r--Tests/CompileFeatures/cxx_default_function_template_args.cpp2
-rw-r--r--Tests/CompileFeatures/cxx_defaulted_functions.cpp3
-rw-r--r--Tests/CompileFeatures/cxx_delegating_constructors.cpp1
-rw-r--r--Tests/CompileFeatures/cxx_digit_separators.cpp3
-rw-r--r--Tests/CompileFeatures/cxx_explicit_conversions.cpp6
-rw-r--r--Tests/CompileFeatures/cxx_extended_friend_declarations.cpp8
-rw-r--r--Tests/CompileFeatures/cxx_extern_templates.cpp2
-rw-r--r--Tests/CompileFeatures/cxx_final.cpp4
-rw-r--r--Tests/CompileFeatures/cxx_generalized_initializers.cpp23
-rw-r--r--Tests/CompileFeatures/cxx_inheriting_constructors.cpp5
-rw-r--r--Tests/CompileFeatures/cxx_inline_namespaces.cpp25
-rw-r--r--Tests/CompileFeatures/cxx_lambda_init_captures.cpp3
-rw-r--r--Tests/CompileFeatures/cxx_lambdas.cpp2
-rw-r--r--Tests/CompileFeatures/cxx_local_type_template_args.cpp28
-rw-r--r--Tests/CompileFeatures/cxx_noexcept.cpp1
-rw-r--r--Tests/CompileFeatures/cxx_nullptr.cpp1
-rw-r--r--Tests/CompileFeatures/cxx_override.cpp6
-rw-r--r--Tests/CompileFeatures/cxx_range_for.cpp5
-rw-r--r--Tests/CompileFeatures/cxx_reference_qualified_functions.cpp12
-rw-r--r--Tests/CompileFeatures/cxx_relaxed_constexpr.cpp10
-rw-r--r--Tests/CompileFeatures/cxx_return_type_deduction.cpp2
-rw-r--r--Tests/CompileFeatures/cxx_right_angle_brackets.cpp4
-rw-r--r--Tests/CompileFeatures/cxx_rvalue_references.cpp1
-rw-r--r--Tests/CompileFeatures/cxx_template_template_parameters.cpp6
-rw-r--r--Tests/CompileFeatures/cxx_uniform_initialization.cpp9
-rw-r--r--Tests/CompileFeatures/cxx_unrestricted_unions.cpp12
-rw-r--r--Tests/CompileFeatures/cxx_user_literals.cpp2
-rw-r--r--Tests/CompileFeatures/cxx_variable_templates.cpp2
-rw-r--r--Tests/CompileFeatures/cxx_variadic_templates.cpp58
-rw-r--r--Tests/CompileFeatures/default_dialect.c24
-rw-r--r--Tests/CompileFeatures/default_dialect.cpp21
-rw-r--r--Tests/CompileFeatures/genex_test.c21
-rw-r--r--Tests/CompileFeatures/genex_test.cpp47
-rw-r--r--Tests/CompileFeatures/main.cpp2
42 files changed, 243 insertions, 192 deletions
diff --git a/Tests/CompileFeatures/c_restrict.c b/Tests/CompileFeatures/c_restrict.c
index 7bc7566..5082da8 100644
--- a/Tests/CompileFeatures/c_restrict.c
+++ b/Tests/CompileFeatures/c_restrict.c
@@ -1,5 +1,5 @@
-int f (int * restrict a, int * restrict b)
+int f(int* restrict a, int* restrict b)
{
(void)a;
(void)b;
diff --git a/Tests/CompileFeatures/cxx_aggregate_default_initializers.cpp b/Tests/CompileFeatures/cxx_aggregate_default_initializers.cpp
index 63a3713..3d1076f 100644
--- a/Tests/CompileFeatures/cxx_aggregate_default_initializers.cpp
+++ b/Tests/CompileFeatures/cxx_aggregate_default_initializers.cpp
@@ -1,5 +1,8 @@
-struct X { int i, j, k = 42; };
+struct X
+{
+ int i, j, k = 42;
+};
int someFunc()
{
diff --git a/Tests/CompileFeatures/cxx_alias_templates.cpp b/Tests/CompileFeatures/cxx_alias_templates.cpp
index a47e27d..0859692 100644
--- a/Tests/CompileFeatures/cxx_alias_templates.cpp
+++ b/Tests/CompileFeatures/cxx_alias_templates.cpp
@@ -7,5 +7,5 @@ struct A
};
using B = A<int, char>;
-template<typename T>
+template <typename T>
using C = A<int, T>;
diff --git a/Tests/CompileFeatures/cxx_alignas.cpp b/Tests/CompileFeatures/cxx_alignas.cpp
index 35b7c82..9fc2c2a 100644
--- a/Tests/CompileFeatures/cxx_alignas.cpp
+++ b/Tests/CompileFeatures/cxx_alignas.cpp
@@ -1,4 +1,5 @@
-struct S1 {
+struct S1
+{
alignas(8) int n;
};
diff --git a/Tests/CompileFeatures/cxx_attribute_deprecated.cpp b/Tests/CompileFeatures/cxx_attribute_deprecated.cpp
index b6f307d..5482db8 100644
--- a/Tests/CompileFeatures/cxx_attribute_deprecated.cpp
+++ b/Tests/CompileFeatures/cxx_attribute_deprecated.cpp
@@ -1,6 +1,5 @@
-[[deprecated]]
-int foo()
+[[deprecated]] int foo()
{
return 0;
}
diff --git a/Tests/CompileFeatures/cxx_attributes.cpp b/Tests/CompileFeatures/cxx_attributes.cpp
index a3c89ea..1434317 100644
--- a/Tests/CompileFeatures/cxx_attributes.cpp
+++ b/Tests/CompileFeatures/cxx_attributes.cpp
@@ -1,2 +1,5 @@
-void unusedFunc [[noreturn]] () { throw 1; }
+void unusedFunc[[noreturn]]()
+{
+ throw 1;
+}
diff --git a/Tests/CompileFeatures/cxx_contextual_conversions.cpp b/Tests/CompileFeatures/cxx_contextual_conversions.cpp
index 3438624..cbc7304 100644
--- a/Tests/CompileFeatures/cxx_contextual_conversions.cpp
+++ b/Tests/CompileFeatures/cxx_contextual_conversions.cpp
@@ -1,33 +1,42 @@
-#define assert(E) if(!(E)) return 1;
+#define assert(E) \
+ if (!(E)) \
+ return 1;
-template<class T>
+template <class T>
class zero_init
{
public:
- zero_init( )
- : val( static_cast<T>(0) ) { }
- zero_init( T val ) : val( val )
- { }
- operator T & ( ) { return val; }
- operator T ( ) const { return val; }
+ zero_init()
+ : val(static_cast<T>(0))
+ {
+ }
+ zero_init(T val)
+ : val(val)
+ {
+ }
+ operator T&() { return val; }
+ operator T() const { return val; }
private:
T val;
};
int someFunc()
{
- zero_init<int*> p; assert( p == 0 );
+ zero_init<int*> p;
+ assert(p == 0);
p = new int(7);
- assert( *p == 7 );
+ assert(*p == 7);
delete p;
- zero_init<int> i; assert( i == 0 );
+ zero_init<int> i;
+ assert(i == 0);
i = 7;
- assert( i == 7 );
- switch( i ) { }
+ assert(i == 7);
+ switch (i) {
+ }
- int *vp = new int[i];
+ int* vp = new int[i];
return 0;
}
diff --git a/Tests/CompileFeatures/cxx_decltype_incomplete_return_types.cpp b/Tests/CompileFeatures/cxx_decltype_incomplete_return_types.cpp
index 109d038..74bcbe1 100644
--- a/Tests/CompileFeatures/cxx_decltype_incomplete_return_types.cpp
+++ b/Tests/CompileFeatures/cxx_decltype_incomplete_return_types.cpp
@@ -1,14 +1,19 @@
-template<class T>
+template <class T>
struct A
{
~A() = delete;
};
-template<class T> auto h() -> A<T>;
-template<class T> auto i(T) -> T;
-template<class T> auto f(T) -> decltype(i(h<T>()));
-template<class T> auto f(T) -> void;
-auto g() -> void {
+template <class T>
+auto h() -> A<T>;
+template <class T>
+auto i(T) -> T;
+template <class T>
+auto f(T) -> decltype(i(h<T>()));
+template <class T>
+auto f(T) -> void;
+auto g() -> void
+{
f(42);
}
diff --git a/Tests/CompileFeatures/cxx_default_function_template_args.cpp b/Tests/CompileFeatures/cxx_default_function_template_args.cpp
index 3d14c52..bcca6aa 100644
--- a/Tests/CompileFeatures/cxx_default_function_template_args.cpp
+++ b/Tests/CompileFeatures/cxx_default_function_template_args.cpp
@@ -1,5 +1,5 @@
-template<typename T = int>
+template <typename T = int>
int someFunc()
{
T t = 0;
diff --git a/Tests/CompileFeatures/cxx_defaulted_functions.cpp b/Tests/CompileFeatures/cxx_defaulted_functions.cpp
index b679a92..3b15adc 100644
--- a/Tests/CompileFeatures/cxx_defaulted_functions.cpp
+++ b/Tests/CompileFeatures/cxx_defaulted_functions.cpp
@@ -1,5 +1,6 @@
-struct A {
+struct A
+{
A() = default;
};
diff --git a/Tests/CompileFeatures/cxx_delegating_constructors.cpp b/Tests/CompileFeatures/cxx_delegating_constructors.cpp
index 4b41615..7e04939 100644
--- a/Tests/CompileFeatures/cxx_delegating_constructors.cpp
+++ b/Tests/CompileFeatures/cxx_delegating_constructors.cpp
@@ -7,7 +7,6 @@ public:
Foo(double d)
: Foo(static_cast<int>(d))
{
-
}
private:
diff --git a/Tests/CompileFeatures/cxx_digit_separators.cpp b/Tests/CompileFeatures/cxx_digit_separators.cpp
index abcd1c8..a40ac0a 100644
--- a/Tests/CompileFeatures/cxx_digit_separators.cpp
+++ b/Tests/CompileFeatures/cxx_digit_separators.cpp
@@ -1,6 +1,5 @@
int someFunc()
{
- int one_thousand = 1'000;
- return one_thousand - 1000;
+ int one_thousand = 1'000; return one_thousand - 1000;
}
diff --git a/Tests/CompileFeatures/cxx_explicit_conversions.cpp b/Tests/CompileFeatures/cxx_explicit_conversions.cpp
index 0decdcd..a34128f 100644
--- a/Tests/CompileFeatures/cxx_explicit_conversions.cpp
+++ b/Tests/CompileFeatures/cxx_explicit_conversions.cpp
@@ -2,9 +2,7 @@
class A
{
int m_i;
+
public:
- explicit operator bool()
- {
- return m_i != 0;
- }
+ explicit operator bool() { return m_i != 0; }
};
diff --git a/Tests/CompileFeatures/cxx_extended_friend_declarations.cpp b/Tests/CompileFeatures/cxx_extended_friend_declarations.cpp
index 631c699..bde94d2 100644
--- a/Tests/CompileFeatures/cxx_extended_friend_declarations.cpp
+++ b/Tests/CompileFeatures/cxx_extended_friend_declarations.cpp
@@ -2,7 +2,11 @@
template <typename T>
struct B
{
- B() : m_i(42) {}
+ B()
+ : m_i(42)
+ {
+ }
+
private:
int m_i;
friend T;
@@ -10,7 +14,7 @@ private:
struct A
{
- template<typename T>
+ template <typename T>
int getBValue(B<T> b)
{
return b.m_i;
diff --git a/Tests/CompileFeatures/cxx_extern_templates.cpp b/Tests/CompileFeatures/cxx_extern_templates.cpp
index 9fa4aa4..01f300a 100644
--- a/Tests/CompileFeatures/cxx_extern_templates.cpp
+++ b/Tests/CompileFeatures/cxx_extern_templates.cpp
@@ -1,5 +1,5 @@
-template<typename T>
+template <typename T>
void someFunc()
{
}
diff --git a/Tests/CompileFeatures/cxx_final.cpp b/Tests/CompileFeatures/cxx_final.cpp
index 598cb94..9d5d5c4 100644
--- a/Tests/CompileFeatures/cxx_final.cpp
+++ b/Tests/CompileFeatures/cxx_final.cpp
@@ -1,2 +1,4 @@
-struct A final {};
+struct A final
+{
+};
diff --git a/Tests/CompileFeatures/cxx_generalized_initializers.cpp b/Tests/CompileFeatures/cxx_generalized_initializers.cpp
index ad05f12..cfe9d98 100644
--- a/Tests/CompileFeatures/cxx_generalized_initializers.cpp
+++ b/Tests/CompileFeatures/cxx_generalized_initializers.cpp
@@ -1,19 +1,22 @@
#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.
namespace std {
- typedef decltype(sizeof(int)) size_t;
- template <class _E>
- class initializer_list
+typedef decltype(sizeof(int)) size_t;
+template <class _E>
+class initializer_list
+{
+ const _E* __begin_;
+ size_t __size_;
+
+public:
+ template <typename T1, typename T2>
+ initializer_list(T1, T2)
{
- const _E* __begin_;
- size_t __size_;
- public:
- template <typename T1, typename T2>
- initializer_list(T1, T2) {}
- };
+ }
+};
}
template <typename T>
diff --git a/Tests/CompileFeatures/cxx_inheriting_constructors.cpp b/Tests/CompileFeatures/cxx_inheriting_constructors.cpp
index cfce880..51400ce 100644
--- a/Tests/CompileFeatures/cxx_inheriting_constructors.cpp
+++ b/Tests/CompileFeatures/cxx_inheriting_constructors.cpp
@@ -3,7 +3,10 @@ struct A
{
int m_i;
- A(int i) : m_i(i) {}
+ A(int i)
+ : m_i(i)
+ {
+ }
};
struct B : public A
diff --git a/Tests/CompileFeatures/cxx_inline_namespaces.cpp b/Tests/CompileFeatures/cxx_inline_namespaces.cpp
index 59fa9c8..77f99e8 100644
--- a/Tests/CompileFeatures/cxx_inline_namespaces.cpp
+++ b/Tests/CompileFeatures/cxx_inline_namespaces.cpp
@@ -1,26 +1,25 @@
-namespace Lib
-{
-inline namespace Lib_1
-{
- template <typename T> class A;
+namespace Lib {
+inline namespace Lib_1 {
+template <typename T>
+class A;
}
-template <typename T> void g(T);
+template <typename T>
+void g(T);
}
-struct MyClass {
-
+struct MyClass
+{
};
-namespace Lib
+namespace Lib {
+template <>
+class A<MyClass>
{
-template<>
-class A<MyClass> {
-
};
}
void someFunc()
{
Lib::A<MyClass> a;
- g(a); // ok, Lib is an associated namespace of A
+ g(a); // ok, Lib is an associated namespace of A
}
diff --git a/Tests/CompileFeatures/cxx_lambda_init_captures.cpp b/Tests/CompileFeatures/cxx_lambda_init_captures.cpp
index 7e337fa..46f22cb 100644
--- a/Tests/CompileFeatures/cxx_lambda_init_captures.cpp
+++ b/Tests/CompileFeatures/cxx_lambda_init_captures.cpp
@@ -2,5 +2,6 @@
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_lambdas.cpp b/Tests/CompileFeatures/cxx_lambdas.cpp
index eecaa23..7cd1fab 100644
--- a/Tests/CompileFeatures/cxx_lambdas.cpp
+++ b/Tests/CompileFeatures/cxx_lambdas.cpp
@@ -1,5 +1,5 @@
void someFunc()
{
- [](){}();
+ []() {}();
}
diff --git a/Tests/CompileFeatures/cxx_local_type_template_args.cpp b/Tests/CompileFeatures/cxx_local_type_template_args.cpp
index 802ea7a..00565e6 100644
--- a/Tests/CompileFeatures/cxx_local_type_template_args.cpp
+++ b/Tests/CompileFeatures/cxx_local_type_template_args.cpp
@@ -1,13 +1,27 @@
template <typename T>
-class X { };
+class X
+{
+};
template <typename T>
-void f(T t) { }
-struct {} unnamed_obj;
-void f() {
- struct A { };
- enum { e1 };
- typedef struct {} B;
+void f(T t)
+{
+}
+struct
+{
+} unnamed_obj;
+void f()
+{
+ struct A
+ {
+ };
+ enum
+ {
+ e1
+ };
+ typedef struct
+ {
+ } B;
B b;
X<A> x1;
X<A*> x2;
diff --git a/Tests/CompileFeatures/cxx_noexcept.cpp b/Tests/CompileFeatures/cxx_noexcept.cpp
index a3c05b8..535e5db 100644
--- a/Tests/CompileFeatures/cxx_noexcept.cpp
+++ b/Tests/CompileFeatures/cxx_noexcept.cpp
@@ -1,5 +1,4 @@
void someFunc() noexcept
{
-
}
diff --git a/Tests/CompileFeatures/cxx_nullptr.cpp b/Tests/CompileFeatures/cxx_nullptr.cpp
index 96307df..a31422d 100644
--- a/Tests/CompileFeatures/cxx_nullptr.cpp
+++ b/Tests/CompileFeatures/cxx_nullptr.cpp
@@ -1,7 +1,6 @@
void someFunc(int*)
{
-
}
void otherFunc()
diff --git a/Tests/CompileFeatures/cxx_override.cpp b/Tests/CompileFeatures/cxx_override.cpp
index 55bec13..3283f2f 100644
--- a/Tests/CompileFeatures/cxx_override.cpp
+++ b/Tests/CompileFeatures/cxx_override.cpp
@@ -1,7 +1,9 @@
-struct A {
+struct A
+{
virtual void doNothing() {}
};
-struct B : A {
+struct B : A
+{
void doNothing() override {}
};
diff --git a/Tests/CompileFeatures/cxx_range_for.cpp b/Tests/CompileFeatures/cxx_range_for.cpp
index 892109e..e3b5724 100644
--- a/Tests/CompileFeatures/cxx_range_for.cpp
+++ b/Tests/CompileFeatures/cxx_range_for.cpp
@@ -3,8 +3,7 @@ void someFunc()
{
int accumulated = 0;
int numbers[] = { 1, 2, 5 };
- for (int i : numbers)
- {
+ for (int i : numbers) {
accumulated += i;
- }
+ }
}
diff --git a/Tests/CompileFeatures/cxx_reference_qualified_functions.cpp b/Tests/CompileFeatures/cxx_reference_qualified_functions.cpp
index 83a2361..2fd36e0 100644
--- a/Tests/CompileFeatures/cxx_reference_qualified_functions.cpp
+++ b/Tests/CompileFeatures/cxx_reference_qualified_functions.cpp
@@ -1,11 +1,13 @@
-struct test{
- void f() & { }
- void f() && { }
+struct test
+{
+ void f() & {}
+ void f() && {}
};
-void someFunc(){
+void someFunc()
+{
test t;
- t.f(); // lvalue
+ t.f(); // lvalue
test().f(); // rvalue
}
diff --git a/Tests/CompileFeatures/cxx_relaxed_constexpr.cpp b/Tests/CompileFeatures/cxx_relaxed_constexpr.cpp
index bce82e3..7b3602c 100644
--- a/Tests/CompileFeatures/cxx_relaxed_constexpr.cpp
+++ b/Tests/CompileFeatures/cxx_relaxed_constexpr.cpp
@@ -1,12 +1,16 @@
-struct X {
- constexpr X() : n(5) {
+struct X
+{
+ constexpr X()
+ : n(5)
+ {
n *= 2;
}
int n;
};
-constexpr int g(const int (&is)[4]) {
+constexpr int g(const int (&is)[4])
+{
X x;
int r = x.n;
for (int i = 0; i < 5; ++i)
diff --git a/Tests/CompileFeatures/cxx_return_type_deduction.cpp b/Tests/CompileFeatures/cxx_return_type_deduction.cpp
index 009e919..a3108df 100644
--- a/Tests/CompileFeatures/cxx_return_type_deduction.cpp
+++ b/Tests/CompileFeatures/cxx_return_type_deduction.cpp
@@ -1,7 +1,7 @@
auto sum(int a, int b)
{
- return a+b;
+ return a + b;
}
int someFunc()
diff --git a/Tests/CompileFeatures/cxx_right_angle_brackets.cpp b/Tests/CompileFeatures/cxx_right_angle_brackets.cpp
index 2713fd8..8f1b0ee 100644
--- a/Tests/CompileFeatures/cxx_right_angle_brackets.cpp
+++ b/Tests/CompileFeatures/cxx_right_angle_brackets.cpp
@@ -1,5 +1,5 @@
-template<typename T>
+template <typename T>
struct A
{
typedef T Result;
@@ -7,6 +7,6 @@ struct A
void someFunc()
{
- A<A<int>> object;
+ A<A<int> > object;
(void)object;
}
diff --git a/Tests/CompileFeatures/cxx_rvalue_references.cpp b/Tests/CompileFeatures/cxx_rvalue_references.cpp
index 787026a..3b85ab6 100644
--- a/Tests/CompileFeatures/cxx_rvalue_references.cpp
+++ b/Tests/CompileFeatures/cxx_rvalue_references.cpp
@@ -1,5 +1,4 @@
void someFunc(int&&)
{
-
}
diff --git a/Tests/CompileFeatures/cxx_template_template_parameters.cpp b/Tests/CompileFeatures/cxx_template_template_parameters.cpp
index 0fdd18d..d57dd36 100644
--- a/Tests/CompileFeatures/cxx_template_template_parameters.cpp
+++ b/Tests/CompileFeatures/cxx_template_template_parameters.cpp
@@ -1,14 +1,12 @@
-template<template <typename> class T, typename U>
+template <template <typename> class T, typename U>
void someFunc(T<U>)
{
-
}
-template<typename T>
+template <typename T>
struct A
{
-
};
void otherFunc()
diff --git a/Tests/CompileFeatures/cxx_uniform_initialization.cpp b/Tests/CompileFeatures/cxx_uniform_initialization.cpp
index 82c76e2..e5048d1 100644
--- a/Tests/CompileFeatures/cxx_uniform_initialization.cpp
+++ b/Tests/CompileFeatures/cxx_uniform_initialization.cpp
@@ -1,9 +1,12 @@
-struct A {};
-struct B {
+struct A
+{
+};
+struct B
+{
B(A) {}
};
void Func()
{
- B b{A{}};
+ B b{ A{} };
}
diff --git a/Tests/CompileFeatures/cxx_unrestricted_unions.cpp b/Tests/CompileFeatures/cxx_unrestricted_unions.cpp
index 698fd61..f6d64f6 100644
--- a/Tests/CompileFeatures/cxx_unrestricted_unions.cpp
+++ b/Tests/CompileFeatures/cxx_unrestricted_unions.cpp
@@ -1,10 +1,16 @@
-struct point {
+struct point
+{
point() {}
- point(int x, int y) : x_(x), y_(y) {}
+ point(int x, int y)
+ : x_(x)
+ , y_(y)
+ {
+ }
int x_, y_;
};
-union u {
+union u
+{
point p_;
int i_;
const char* s_;
diff --git a/Tests/CompileFeatures/cxx_user_literals.cpp b/Tests/CompileFeatures/cxx_user_literals.cpp
index 9e5a588..5144204 100644
--- a/Tests/CompileFeatures/cxx_user_literals.cpp
+++ b/Tests/CompileFeatures/cxx_user_literals.cpp
@@ -1,5 +1,5 @@
-long double operator "" _meters(long double);
+long double operator"" _meters(long double);
void someFunc()
{
diff --git a/Tests/CompileFeatures/cxx_variable_templates.cpp b/Tests/CompileFeatures/cxx_variable_templates.cpp
index 5d4bdbc..8e6fc99 100644
--- a/Tests/CompileFeatures/cxx_variable_templates.cpp
+++ b/Tests/CompileFeatures/cxx_variable_templates.cpp
@@ -1,5 +1,5 @@
-template<typename T>
+template <typename T>
constexpr T pi = T(3.1415926535897932385);
int someFunc()
diff --git a/Tests/CompileFeatures/cxx_variadic_templates.cpp b/Tests/CompileFeatures/cxx_variadic_templates.cpp
index e1f641b..3dc2570 100644
--- a/Tests/CompileFeatures/cxx_variadic_templates.cpp
+++ b/Tests/CompileFeatures/cxx_variadic_templates.cpp
@@ -3,63 +3,61 @@
#endif
#ifdef OLD_GNU
-template<int... Is>
+template <int... Is>
struct Interface;
#endif
-template<int I, int... Is>
+template <int I, int... Is>
struct Interface
#ifdef OLD_GNU
- <I, Is...>
+ <I, Is...>
#endif
{
- static int accumulate()
- {
- return I + Interface<Is...>::accumulate();
- }
+ static int accumulate() { return I + Interface<Is...>::accumulate(); }
};
-template<int I>
+template <int I>
struct Interface<I>
{
- static int accumulate()
- {
- return I;
- }
+ static int accumulate() { return I; }
};
// Note: split this into a separate test if a
// cxx_variadic_template_template_parameters feature is added.
-template<typename T>
-struct eval {
- enum {
+template <typename T>
+struct eval
+{
+ enum
+ {
Matched = 0
};
};
-template<template<typename...> class T, typename... U>
-struct eval<T<U...> > {
- enum {
+template <template <typename...> class T, typename... U>
+struct eval<T<U...> >
+{
+ enum
+ {
Matched = 1
};
};
-template<typename...>
-struct A {
-
+template <typename...>
+struct A
+{
};
-template<typename T>
-struct B {
-
+template <typename T>
+struct B
+{
};
-template<typename T, typename U>
-struct C {
-
+template <typename T, typename U>
+struct C
+{
};
-template<typename T, typename U, typename...>
-struct D {
-
+template <typename T, typename U, typename...>
+struct D
+{
};
// Note: This test assumes that a compiler supporting this feature
diff --git a/Tests/CompileFeatures/default_dialect.c b/Tests/CompileFeatures/default_dialect.c
index 1b39dec..0e67095 100644
--- a/Tests/CompileFeatures/default_dialect.c
+++ b/Tests/CompileFeatures/default_dialect.c
@@ -1,19 +1,19 @@
#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__)
-# error Unexpected __STDC_VERSION__ definition
-# endif
+#if !DEFAULT_C90
+#error Buildsystem error
+#endif
+#if defined(__STDC_VERSION__)
+#error Unexpected __STDC_VERSION__ definition
+#endif
#endif
int main()
diff --git a/Tests/CompileFeatures/default_dialect.cpp b/Tests/CompileFeatures/default_dialect.cpp
index a2ca268..0efaefa 100644
--- a/Tests/CompileFeatures/default_dialect.cpp
+++ b/Tests/CompileFeatures/default_dialect.cpp
@@ -1,22 +1,23 @@
-template<long l>
+template <long l>
struct Outputter;
#if DEFAULT_CXX14
-# if __cplusplus != 201402L
+#if __cplusplus != 201402L
Outputter<__cplusplus> o;
-# endif
+#endif
#elif DEFAULT_CXX11
-# if __cplusplus != 201103L
+#if __cplusplus != 201103L
Outputter<__cplusplus> o;
-# endif
+#endif
#else
-# if !DEFAULT_CXX98
-# error Buildsystem error
-# endif
-# if __cplusplus != 199711L && __cplusplus != 1 && !defined(__GXX_EXPERIMENTAL_CXX0X__)
+#if !DEFAULT_CXX98
+#error Buildsystem error
+#endif
+#if __cplusplus != 199711L && __cplusplus != 1 && \
+ !defined(__GXX_EXPERIMENTAL_CXX0X__)
Outputter<__cplusplus> o;
-# endif
+#endif
#endif
int main()
diff --git a/Tests/CompileFeatures/genex_test.c b/Tests/CompileFeatures/genex_test.c
index b1215bd..1d54840 100644
--- a/Tests/CompileFeatures/genex_test.c
+++ b/Tests/CompileFeatures/genex_test.c
@@ -1,11 +1,11 @@
#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 !EXPECT_C_STATIC_ASSERT
@@ -19,20 +19,19 @@
#endif
#if !EXPECT_C_FUNCTION_PROTOTYPES
-# error Expect c_function_prototypes support
+#error Expect c_function_prototypes support
#endif
#if !EXPECT_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 2161bca..5ae8a78 100644
--- a/Tests/CompileFeatures/genex_test.cpp
+++ b/Tests/CompileFeatures/genex_test.cpp
@@ -1,14 +1,14 @@
#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
#if !HAVE_OVERRIDE_CONTROL
@@ -33,40 +33,39 @@ 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()
{
-
}
diff --git a/Tests/CompileFeatures/main.cpp b/Tests/CompileFeatures/main.cpp
index 3a8e0fc..c5a7a46 100644
--- a/Tests/CompileFeatures/main.cpp
+++ b/Tests/CompileFeatures/main.cpp
@@ -1,5 +1,5 @@
-int main(int,char**)
+int main(int, char**)
{
auto value = 0;
return value;