From 65ed9e1daef7a15ca41c43c9e73dd1f3bae40279 Mon Sep 17 00:00:00 2001 From: peter klausler Date: Wed, 28 Feb 2018 14:53:04 -0800 Subject: [PATCH] [flang] Run clang-format. Original-commit: flang-compiler/f18@cd52d99f219be0f37c36cf644f4bffae3b537f31 Reviewed-on: https://github.com/flang-compiler/f18/pull/20 Tree-same-pre-rewrite: false --- flang/lib/parser/idioms.h | 21 +++++++++++++-------- flang/lib/parser/parse-tree-visitor.h | 19 +++++++------------ 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/flang/lib/parser/idioms.h b/flang/lib/parser/idioms.h index d80bdc0..b0d9bb2 100644 --- a/flang/lib/parser/idioms.h +++ b/flang/lib/parser/idioms.h @@ -88,18 +88,23 @@ template struct BadType : std::false_type {}; // in template specialization definitions. #define CLASS_TRAIT(T) \ namespace class_trait_ns_##T { \ - template std::true_type test(typename A::T *); \ - template std::false_type test(...); \ - template \ + template std::true_type test(typename A::T *); \ + template std::false_type test(...); \ + template \ constexpr bool has_trait{decltype(test(nullptr))::value}; \ - template \ + template \ constexpr typename std::enable_if, bool>::type \ - trait_value() { using U = typename A::T; return U::value; } \ - template \ + trait_value() { \ + using U = typename A::T; \ + return U::value; \ + } \ + template \ constexpr typename std::enable_if, bool>::type \ - trait_value() { return false; } \ + trait_value() { \ + return false; \ + } \ } \ - template constexpr bool T{class_trait_ns_##T::trait_value()} + template constexpr bool T { class_trait_ns_##T::trait_value() } // Formatting // TODO: remove when unparser is up and running diff --git a/flang/lib/parser/parse-tree-visitor.h b/flang/lib/parser/parse-tree-visitor.h index 9953a60..24aac70 100644 --- a/flang/lib/parser/parse-tree-visitor.h +++ b/flang/lib/parser/parse-tree-visitor.h @@ -21,10 +21,10 @@ namespace parser { // Default case for visitation of non-class data members (and strings) template typename std::enable_if || - std::is_same_v>::type + std::is_same_v>::type Walk(const A &x, V &visitor) { if (visitor.Pre(x)) { - visitor.Post(x); + visitor.Post(x); } } @@ -64,16 +64,14 @@ void Walk(const std::variant &x, V &visitor) { // Trait-determined traversal of empty, tuple, union, and wrapper classes. template -typename std::enable_if>::type -Walk(const A &x, V &visitor) { +typename std::enable_if>::type Walk(const A &x, V &visitor) { if (visitor.Pre(x)) { visitor.Post(x); } } template -typename std::enable_if>::type -Walk(const A &x, V &visitor) { +typename std::enable_if>::type Walk(const A &x, V &visitor) { if (visitor.Pre(x)) { Walk(x.t, visitor); visitor.Post(x); @@ -81,8 +79,7 @@ Walk(const A &x, V &visitor) { } template -typename std::enable_if>::type -Walk(const A &x, V &visitor) { +typename std::enable_if>::type Walk(const A &x, V &visitor) { if (visitor.Pre(x)) { Walk(x.u, visitor); visitor.Post(x); @@ -90,8 +87,7 @@ Walk(const A &x, V &visitor) { } template -typename std::enable_if>::type -Walk(const A &x, V &visitor) { +typename std::enable_if>::type Walk(const A &x, V &visitor) { if (visitor.Pre(x)) { Walk(x.v, visitor); visitor.Post(x); @@ -150,8 +146,7 @@ void Walk(const CharSelector::LengthAndKind &x, V &visitor) { visitor.Post(x); } } -template -void Walk(const CaseValueRange::Range &x, V &visitor) { +template void Walk(const CaseValueRange::Range &x, V &visitor) { if (visitor.Pre(x)) { Walk(x.lower, visitor); Walk(x.upper, visitor); -- 2.7.4