[PATCH] D134874: [Concepts] Fix Concepts on generic lambda in a VarTemplateSpecDecl

2022-10-01 Thread Johel Ernesto Guerrero Peña via Phabricator via cfe-commits
JohelEGP added a comment.

I can confirm that, with this patch, Clang successfully compiles my actual code 
base.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D134874/new/

https://reviews.llvm.org/D134874

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D131388: [docs] Add "C++20 Modules"

2022-08-19 Thread Johel Ernesto Guerrero Peña via Phabricator via cfe-commits
JohelEGP requested changes to this revision.
JohelEGP added inline comments.
This revision now requires changes to proceed.



Comment at: clang/docs/CPlusPlus20Modules.rst:290
+``primary module interface unit`` by ``-fmodule-file``
+since the langugae specification says a module implementation unit implicitly 
imports
+the primary module interface unit.





Comment at: clang/docs/CPlusPlus20Modules.rst:457
+
+The declarations in a module unit which are not in global module fragment have 
new linkage names.
+




CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D131388/new/

https://reviews.llvm.org/D131388

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D120806: [clang-format] Recognize "if consteval".

2022-03-02 Thread Johel Ernesto Guerrero Peña via Phabricator via cfe-commits
JohelEGP accepted this revision.
JohelEGP added a comment.

My few cases format consistently with the condition case:

  diff
  diff --git a/tests/integration/test.waarudo.io.dynamic.cpp 
b/tests/integration/test.waarudo.io.dynamic.cpp
  index be5a626..e1265b9 100644
  --- a/tests/integration/test.waarudo.io.dynamic.cpp
  +++ b/tests/integration/test.waarudo.io.dynamic.cpp
  @@ -21,7 +21,7 @@ public:
 }
   
 constexpr ~input_source() {
  -if (std::is_constant_evaluated()) {
  +if consteval {
 expects(input_byte == previous_input_byte);
   } else {
 std::ofstream{"test.waarudo.io.dynamic.previous.input.byte.txt"} << 
"waarudo::byte{'"
  @@ -37,7 +37,7 @@ public:
 [[nodiscard]] constexpr waarudo::output_bytes output() override { return 
{&output_byte, 1z}; }
   
 constexpr ~output_destination() {
  -if (std::is_constant_evaluated()) {
  +if consteval {
 expects(output_byte == previous_output_byte);
   } else {
 std::cout << std::bit_cast(output_byte);
  diff --git a/tests/waarudo.test.utilities.cpp 
b/tests/waarudo.test.utilities.cpp
  index ed82b2b..f4ec8e3 100644
  --- a/tests/waarudo.test.utilities.cpp
  +++ b/tests/waarudo.test.utilities.cpp
  @@ -13,7 +13,7 @@ export template concept constant_invocable = 
requires { typename std::in
   export using waarudo::expects;
   
   export constexpr void runtime(void (*const f)()) {
  -  if (not std::is_constant_evaluated()) f();
  +  if not consteval { f(); }
   }
   
   template F> void visit_values(F f) {

Thank you.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D120806/new/

https://reviews.llvm.org/D120806

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D120806: [clang-format] Recognize "if consteval".

2022-03-02 Thread Johel Ernesto Guerrero Peña via Phabricator via cfe-commits
JohelEGP added a comment.

In D120806#3354119 , @MyDeveloperDay 
wrote:

> LFTM
>
> Do we also need to consider this in the context of "AllowShortIfStatments"?  
> (that would be in a different review in my view)

Definitely. Since it didn't work at all, I reported it without a 
`.clang-format`. I was hoping it'd play well with `AllowShortIfStatments` out 
of the box.
I'm currently building `HEAD` with this patch to reformat my code.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D120806/new/

https://reviews.llvm.org/D120806

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D119893: [clang-format] Fixed handling of requires clauses followed by attributes

2022-02-16 Thread Johel Ernesto Guerrero Peña via Phabricator via cfe-commits
JohelEGP accepted this revision.
JohelEGP added a comment.
This revision is now accepted and ready to land.

Thank you.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119893/new/

https://reviews.llvm.org/D119893

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D116007: [clang-format] Fix BreakBeforeBraces: Attach ignored with trailing requires-expression of function.

2021-12-20 Thread Johel Ernesto Guerrero Peña via Phabricator via cfe-commits
JohelEGP added a comment.

Thank you for doing this.

With the patch, I get this diff:

  diff
  diff --git a/sources/details/waarudo.details.utilities.cpp 
b/sources/details/waarudo.details.utilities.cpp
  index 0b3680e..6e234ac 100644
  --- a/sources/details/waarudo.details.utilities.cpp
  +++ b/sources/details/waarudo.details.utilities.cpp
  @@ -7,8 +7,8 @@ namespace waarudo {
   
   export template class U> concept 
specialization_of = //
 (requires(T v) {
  -[](U) requires std::same_as> { }
  -(v);
  +[](U) requires std::same_as> {
  +}(v);
 });
   
   template concept value_trait_for = //
  diff --git a/sources/waarudo.quantities.cpp b/sources/waarudo.quantities.cpp
  index 83a17db..fdc4c53 100644
  --- a/sources/waarudo.quantities.cpp
  +++ b/sources/waarudo.quantities.cpp
  @@ -52,12 +52,20 @@ export template struct quantity {
   requires std::convertible_to
 [[nodiscard]] constexpr operator quantity() const { return 
{number}; }
   
  -  constexpr quantity& operator++() & requires ordered_number { 
return ++number, *this; }
  -  constexpr quantity& operator--() & requires ordered_number { 
return --number, *this; }
  -  [[nodiscard]] constexpr quantity operator++(int) & requires 
ordered_number { return {number++}; }
  -  [[nodiscard]] constexpr quantity operator--(int) & requires 
ordered_number { return {number--}; }
  +  constexpr quantity& operator++() & requires ordered_number {
  +return ++number, *this;
  +  } constexpr quantity& operator--() & requires ordered_number {
  +return --number, *this;
  +  } [[nodiscard]] constexpr quantity operator++(int) & requires 
ordered_number {
  +return {number++};
  +  } [[nodiscard]] constexpr quantity operator--(int) & requires 
ordered_number {
  +return {number--};
  +  }
   
  -  constexpr quantity& operator+=(const relative_quantity_for auto& 
d) & { return number += d.number, *this; }
  +  constexpr quantity&
  +  operator+=(const relative_quantity_for auto& d) & {
  +return number += d.number, *this;
  +  }
 constexpr quantity& operator-=(const relative_quantity_for auto& 
d) & { return number -= d.number, *this; }
   
 template Q>

Here's how it looks without the patch:

  namespace waarudo {
  
  export template class U> concept 
specialization_of = //
(requires(T v) {
  [](U) requires std::same_as> { }
  (v);
});
  
  struct x {
constexpr quantity& operator++() & requires ordered_number { return 
++number, *this; }
constexpr quantity& operator--() & requires ordered_number { return 
--number, *this; }
[[nodiscard]] constexpr quantity operator++(int) & requires 
ordered_number { return {number++}; }
[[nodiscard]] constexpr quantity operator--(int) & requires 
ordered_number { return {number--}; }
  
constexpr quantity& operator+=(const relative_quantity_for auto& 
d) & { return number += d.number, *this; }
constexpr quantity& operator-=(const relative_quantity_for auto& 
d) & { return number -= d.number, *this; }
  };
  
  } // namespace waarudo

Here's my `.clang-format`:

  AccessModifierOffset: -2
  AlignAfterOpenBracket: AlwaysBreak
  AlignArrayOfStructures: None
  AlignConsecutiveAssignments: Consecutive
  AlignConsecutiveBitFields: true
  AlignConsecutiveDeclarations: false
  AlignEscapedNewlines: Right
  AlignOperands: Align
  AlignTrailingComments: true
  AllowAllArgumentsOnNextLine: true
  AllowAllConstructorInitializersOnNextLine: true
  AllowAllParametersOfDeclarationOnNextLine: true
  AllowShortBlocksOnASingleLine: Always
  AllowShortCaseLabelsOnASingleLine: true
  AllowShortEnumsOnASingleLine: true
  AllowShortFunctionsOnASingleLine: All
  AllowShortIfStatementsOnASingleLine: AllIfsAndElse
  AllowShortLambdasOnASingleLine: All
  AllowShortLoopsOnASingleLine: true
  AlwaysBreakAfterReturnType: None
  AlwaysBreakBeforeMultilineStrings: false
  AlwaysBreakTemplateDeclarations: No
  BinPackArguments: true
  BinPackParameters: true
  BitFieldColonSpacing: Both
  BreakBeforeBinaryOperators: None
  BreakBeforeBraces: Attach
  BreakBeforeConceptDeclarations: false
  BreakBeforeTernaryOperators: true
  BreakConstructorInitializers: BeforeColon
  BreakInheritanceList: BeforeColon
  BreakStringLiterals: true
  ColumnLimit: 120
  ConstructorInitializerAllOnOneLineOrOnePerLine: true
  ConstructorInitializerIndentWidth: 2
  ContinuationIndentWidth: 2
  Cpp11BracedListStyle: true
  DeriveLineEnding: false
  DerivePointerAlignment: false
  DisableFormat: false
  EmptyLineAfterAccessModifier: Never
  EmptyLineBeforeAccessModifier: Always
  FixNamespaceComments: true
  IncludeBlocks: Preserve
  IncludeCategories:
- Regex:  '<(experimental/)?[a-z_]+>' # C++ standard library
  Priority:   1
  IndentAccessModifiers: false
  IndentCaseBlocks: false
  IndentCaseLabels: false
  IndentPPDirectives: AfterHash
  IndentRequires: true
  IndentWidth: 2
  IndentWrappedFunctionNames: false
  KeepEmptyLinesAtTheStartOfBlocks: false
  Language: Cpp
  Max

[PATCH] D93839: [clang-format] PR48594 BraceWrapping: SplitEmptyRecord ignored for templates

2020-12-27 Thread Johel Ernesto Guerrero Peña via Phabricator via cfe-commits
JohelEGP added a comment.

I have another case:
`.clang-format`:

  BraceWrapping:
AfterStruct: true
SplitEmptyRecord: true
  BreakBeforeBraces: Custom

Input and expected formatted output:

  template  struct rep>
  {
using type = T;
  };

Actual formatted output:

  template  struct rep>
  { using type = T; };


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93839/new/

https://reviews.llvm.org/D93839

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D93839: [clang-format] PR48594 BraceWrapping: SplitEmptyRecord ignored for templates

2020-12-27 Thread Johel Ernesto Guerrero Peña via Phabricator via cfe-commits
JohelEGP accepted this revision.
JohelEGP added a comment.
This revision is now accepted and ready to land.

Thank you.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93839/new/

https://reviews.llvm.org/D93839

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D79773: [clang-format] Improve clang-formats handling of concepts

2020-12-04 Thread Johel Ernesto Guerrero Peña via Phabricator via cfe-commits
JohelEGP added a comment.

Yes, here's my reply: https://bugs.llvm.org/show_bug.cgi?id=47161#c2.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79773/new/

https://reviews.llvm.org/D79773

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D79773: [clang-format] Improve clang-formats handling of concepts

2020-12-04 Thread Johel Ernesto Guerrero Peña via Phabricator via cfe-commits
JohelEGP added a comment.

I was a bit late, but thanks for everything!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79773/new/

https://reviews.llvm.org/D79773

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D79773: [clang-format] Improve clang-formats handling of concepts

2020-10-20 Thread Johel Ernesto Guerrero Peña via Phabricator via cfe-commits
JohelEGP added a comment.

Could you do a rebase? The patch no longer applies:

  error: patch failed: clang/docs/ClangFormatStyleOptions.rst:2711
  error: clang/docs/ClangFormatStyleOptions.rst: patch does not apply
  error: patch failed: clang/docs/ReleaseNotes.rst:398
  error: clang/docs/ReleaseNotes.rst: patch does not apply
  error: patch failed: clang/lib/Format/FormatToken.h:470
  error: clang/lib/Format/FormatToken.h: patch does not apply
  error: patch failed: clang/lib/Format/TokenAnnotator.cpp:1337
  error: clang/lib/Format/TokenAnnotator.cpp: patch does not apply


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79773/new/

https://reviews.llvm.org/D79773

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D79773: [clang-format] Improve clang-formats handling of concepts

2020-08-13 Thread Johel Ernesto Guerrero Peña via Phabricator via cfe-commits
JohelEGP added a comment.

In D79773#2141164 , @MyDeveloperDay 
wrote:

> This is actually failing in the handling of parsing the `<>`  in 
> (`parseAngle()` actually `parseBrace()` inside of that), it is not really 
> concepts specific except it may be seen now because of the presence of the `;`

I opened LLVM 47161  to defer this 
to upstream.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79773/new/

https://reviews.llvm.org/D79773

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D79773: [clang-format] Improve clang-formats handling of concepts

2020-08-10 Thread Johel Ernesto Guerrero Peña via Phabricator via cfe-commits
JohelEGP added a comment.

I found another case. See how everything after the //requires-clause// is 
indented for constructors with just the constructor's name (it works otherwise, 
maybe because it looks like a function).

  class [[nodiscard]] data_t
  {
  public:
  template 
  requires std::same_as, 
flippable_tile_id>
  /*explicit*/ data_t(R&& ids, const format_t f = encoding_t::csv)
: format_t{f}, tile_ids_{ranges::to_vector(std::forward(ids))}
  {
  }
  
  [[nodiscard]] bool operator==(const data_t&) const = default;
  };


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79773/new/

https://reviews.llvm.org/D79773

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D79773: [clang-format] Improve clang-formats handling of concepts

2020-07-08 Thread Johel Ernesto Guerrero Peña via Phabricator via cfe-commits
JohelEGP added a comment.

Ah, that makes sense. The very definition of Allman is to always break before 
braces. I suppose I'll need to use `BreakBeforeBraces: Custom` and 
`BraceWrapping:`. I did some testing and noticed that the weird format comes 
with any of these:

  BreakBeforeBraces: Custom
  BraceWrapping:
AfterControlStatement: MultiLine

  BreakBeforeBraces: Custom
  BraceWrapping:
AfterFunction: true

Since a requires-expression is neither a control statement nor a function, I 
suppose it might eventually need its own `BraceWrapping` nested configuration 
flag. For now, I'd prefer if they never break.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79773/new/

https://reviews.llvm.org/D79773



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D79773: [clang-format] Improve clang-formats handling of concepts

2020-07-06 Thread Johel Ernesto Guerrero Peña via Phabricator via cfe-commits
JohelEGP added a comment.

Yes, it's valid C++ (is my hope). It's from WIP code, which I made available to 
show you: https://github.com/johelegp/jge.

Here it is building, running and passing the tests: 
https://travis-ci.com/github/johelegp/jge/jobs/358137355#L559.

Here are links to the above linked snippets:

- Now looking good:
  - 
https://github.com/johelegp/jge/blob/master/include/jge/cartesian.hpp#L84-L90
  - https://github.com/johelegp/jge/blob/master/include/jge/plane.hpp#L54-L59
  - https://github.com/johelegp/jge/blob/master/tests/jge/cartesian.cpp#L18-L20.
- Just reported:
  - Inheritance: 
https://github.com/johelegp/jge/blob/master/tests/jge/cartesian.cpp#L11-L21 
(https://reviews.llvm.org/D79773#2131680)
  - Non list-initialization: 
https://github.com/johelegp/jge/blob/master/tests/jge/cartesian.cpp#L11-L16 
(https://reviews.llvm.org/D79773#2132086)
  - For the `EqualityComparable` case 
(https://reviews.llvm.org/D79773#2131680), I use this macro: 
https://github.com/johelegp/jge/blob/master/include/jge/detail/quantity_wrappers.hpp#L4-L5.
 Example: 
https://github.com/johelegp/jge/blob/master/include/jge/detail/quantity_wrappers.hpp#L59.
 I also used it before the previous fixes besides `//` comments.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79773/new/

https://reviews.llvm.org/D79773



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D79773: [clang-format] Improve clang-formats handling of concepts

2020-07-05 Thread Johel Ernesto Guerrero Peña via Phabricator via cfe-commits
JohelEGP added a comment.

Another weird formatting when direct-initializing a variable with a 
non-parenthesized requires-expression:

  constexpr void test_width()
  {
  bool invalid_rep{!requires {typename jge::width;
  }
  }
  ;
  }

vs

  constexpr void test_width()
  {
  bool invalid_rep{!(requires { typename jge::width; })};
  bool invalid_rep = !(requires { typename jge::width; });
  bool invalid_rep = !requires
  {
  typename jge::width;
  };
  }


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79773/new/

https://reviews.llvm.org/D79773



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D79773: [clang-format] Improve clang-formats handling of concepts

2020-07-04 Thread Johel Ernesto Guerrero Peña via Phabricator via cfe-commits
JohelEGP requested changes to this revision.
JohelEGP added a comment.
This revision now requires changes to proceed.

Thank you. Everything I reported works fine now.

I have two more cases for now. First are your examples in the OP.
You have

  template 
  concept bool EqualityComparable = requires(T a, T b) {
{ a == b } -> bool;
  };

But this is what I get:

  template 
  concept bool EqualityComparable = requires(T a, T b)
  {
  {
  a == b
  } -> bool;
  };

Perhaps it's because I compiled against commit 
`71d88cebfb42c8c5ac2d54b42afdcca956e55660` (Fri Jul 3 13:46:41 2020 -0400).
Next:

  template 
  requires std::invocable...>
  struct [[nodiscard]] constant : std::bool_constant < requires
  {
  typename _require_constant_<(std::invoke(F{}, Args{}()...), 0)>;
  } > {};

There's spaces around the template brackets. The lack of indentation is also 
odd, considering that in this context things are indented.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79773/new/

https://reviews.llvm.org/D79773



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D79773: [clang-format] Improve clang-formats handling of concepts

2020-07-01 Thread Johel Ernesto Guerrero Peña via Phabricator via cfe-commits
JohelEGP added a comment.

Using parameter packs within non-parenthesized requires-clauses results in 
weird formatting:

  template 
  requires std::invocable < F, std::invoke_result_t
  ... > struct constant;

vs

  template 
  requires(std::invocable...>)
  struct constant;


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79773/new/

https://reviews.llvm.org/D79773



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D79773: [clang-format] Improve clang-formats handling of concepts

2020-07-01 Thread Johel Ernesto Guerrero Peña via Phabricator via cfe-commits
JohelEGP added a comment.

In D79773#2125040 , @MyDeveloperDay 
wrote:

> Just so I'm clear for this and your Allman coment would you show me what you 
> are seeing and what you expect to see? just so I understand.


Sure, thank you.

This is what I have, as shown above. Actually fixed to show surrounding 
context, which is relevant to formatting. Note the `//` comment:

  namespace jge
  {
  template 
  struct [[nodiscard]] size2d
  {
  template 
  friend constexpr auto
  operator*(const size2d& l, const units::quantity& r) noexcept(
  noexcept(l.w* r)) requires(requires { l.w* r; }) //
  {
  return size2d{l.w * r, l.h * r};
  }
  };
  
  } // namespace jge

I added `//` to make the formatting look like what I want. If I remove it, this 
is what I get:

  namespace jge
  {
  template 
  struct [[nodiscard]] size2d
  {
  template 
  friend constexpr auto
  operator*(const size2d& l, const units::quantity& r) noexcept(
  noexcept(l.w* r)) requires(requires { l.w* r; }) {
  return size2d{l.w * r, l.h * r};
  }
  };
  
  } // namespace jge

So this is what I want, without the `//` comment:

  namespace jge
  {
  template 
  struct [[nodiscard]] size2d
  {
  template 
  friend constexpr auto
  operator*(const size2d& l, const units::quantity& r) noexcept(
  noexcept(l.w* r)) requires(requires { l.w* r; }) 
  {
  return size2d{l.w * r, l.h * r};
  }
  };
  
  } // namespace jge

For the constructor initializer list, this is what I have. Note the parentheses 
in the first requires-clause:

  namespace jge
  {
  template 
  class [[nodiscard]] plane
  {
  constexpr plane(const plane& other) noexcept(
  (detail::default_allocator_is_nothrow &&
   std::is_nothrow_copy_constructible_v)) requires(std::copyable)
: plane{to1d(other), other.sz.w}
  {
  }
  
  constexpr plane& operator=(const plane& other) noexcept(
  (std::is_nothrow_copy_constructible_v &&
   std::is_nothrow_copy_assignable_v)) requires std::copyable //
  {
  assign(to1d(other), other.sz.w);
  return *this;
  }
  };
  
  } // namespace jge

This is what I get without the parentheses. Note that all code after the 
constructor initializer list is further indented:

  namespace jge
  {
  template 
  class [[nodiscard]] plane
  {
  constexpr plane(const plane& other) noexcept(
  (detail::default_allocator_is_nothrow &&
   std::is_nothrow_copy_constructible_v)) requires std::copyable
: plane{to1d(other), other.sz.w}
{
}
  
constexpr plane& operator=(const plane& other) noexcept(
(std::is_nothrow_copy_constructible_v &&
 std::is_nothrow_copy_assignable_v)) requires std::copyable //
{
assign(to1d(other), other.sz.w);
return *this;
}
  };
  
  } // namespace jge

So this is what I want. Without extra parentheses, nor extra indentation:

  namespace jge
  {
  template 
  class [[nodiscard]] plane
  {
  constexpr plane(const plane& other) noexcept(
  (detail::default_allocator_is_nothrow &&
   std::is_nothrow_copy_constructible_v)) requires std::copyable
: plane{to1d(other), other.sz.w}
  {
  }
  
  constexpr plane& operator=(const plane& other) noexcept(
  (std::is_nothrow_copy_constructible_v &&
   std::is_nothrow_copy_assignable_v)) requires std::copyable //
  {
  assign(to1d(other), other.sz.w);
  return *this;
  }
  };
  
  } // namespace jge

All with the config file 
 linked 
above.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79773/new/

https://reviews.llvm.org/D79773



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D79773: [clang-format] Improve clang-formats handling of concepts

2020-06-30 Thread Johel Ernesto Guerrero Peña via Phabricator via cfe-commits
JohelEGP added a comment.

  constexpr plane(const plane& other) noexcept(
  (detail::default_allocator_is_nothrow &&
   std::is_nothrow_copy_constructible_v)) requires(std::copyable)
: plane{to1d(other), other.sz.w}
  {
  }

Without the parentheses in trailing requires-clauses, all code following the 
constructor initializer list is further indented.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79773/new/

https://reviews.llvm.org/D79773



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D79773: [clang-format] Improve clang-formats handling of concepts

2020-06-25 Thread Johel Ernesto Guerrero Peña via Phabricator via cfe-commits
JohelEGP requested changes to this revision.
JohelEGP added a comment.
This revision now requires changes to proceed.

`BreakBeforeBraces: Allman` isn't respected.

  template 
  friend constexpr auto
  operator*(const size2d& l, const units::quantity& r) noexcept(
  noexcept(l.w* r)) requires(requires { l.w* r; }) //
  {
  return size2d{l.w * r, l.h * r};
  }

When a trailing //requires-clause// is right before the function body, its 
opening brace should go on its own line, as dictated by my config file 
.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79773/new/

https://reviews.llvm.org/D79773



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits