<div dir="ltr">No, there is no way at the moment and I also don't know whether this can even be done (considering that clang-format doesn't have type information and doesn't really understand macros).</div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jun 10, 2016 at 8:07 PM, Philippe Canal via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
Given the two functions:<br>
<br>
   SOMEMACRO<br>
   Precision One() const;<br>
<br>
   inline<br>
   Precision Two() const;<br>
<br>
   __device__<br>
   Precision Three() const;<br>
<br>
   template <bool ForInnerSurface><br>
   SOMEMACRO<br>
   Precision TemplateOne() const;<br>
<br>
   template <bool ForInnerSurface><br>
   inline<br>
   Precision TemplateTwo() const;<br>
<br>
   template <bool ForInnerSurface><br>
   __device__<br>
   Precision TemplateThree() const;<br>
<br>
with AlwaysBreakTemplateDeclarations set to true, I would like the code to remained unchanged after process via clang-format. However the result is<br>
<br>
   SOMEMACRO<br>
   Precision One() const;<br>
<br>
   inline Precision Two() const;<br>
<br>
   __device__ Precision Three() const;<br>
<br>
   template <bool ForInnerSurface><br>
   SOMEMACRO Precision TemplateOne() const;<br>
<br>
   template <bool ForInnerSurface><br>
   inline Precision TemplateTwo() const;<br>
<br>
   template <bool ForInnerSurface><br>
   __device__ Precision TemplateThree() const;<br>
<br>
Note that the macro and the keyword are treated differently for the regular function (see One() vs Two()).<br>
<br>
In practice, clang-format seems to leave the placement of SOMEMACRO unchanged (i.e. if it was originally on the same line as the function decl, it stays there).<br>
<br>
Is there a way to force a break *before* the return type?<br>
<br>
Thanks,<br>
Philippe<br>
<br>
<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</blockquote></div><br></div>