[cfe-dev] clang format: proper indention for the goto destination point

Daniel Jasper djasper at google.com
Tue Jul 14 00:44:02 PDT 2015


FWIW, I agree that we are not doing a great job with labels and there are a
bunch of improvements that we could do. However, it is also very close to
the bottom of my priority list, so I don't see myself working on this in
the foreseeable future. Patches are always welcome. You could also file a
feature request on http://llvm.org/bugs (there is a dedicated "Formatter"
component) to ensure this stays on the long-term radar.

Cheers,
Daniel

On Tue, Jul 14, 2015 at 1:46 AM, Jason Juang <jasjuang at gmail.com> wrote:

> When using clang format based on google style.
>
> It reformat the following code to
>
> int main() {
>   for (int i = 1; i < 10; i++)
>     for (int j = 0; j < 5; j++) {
>       // do something
>       goto end_double_loop;
>     }
> end_double_loop : {}
>
>   return 0;}
>
> Could someone add a clang format style options so the "end_double_loop"
> will be aligned to the first for loop instead of int main? Meaning the
> desired format is
>
> int main() {
>   for (int i = 1; i < 10; i++)
>     for (int j = 0; j < 5; j++) {
>       // do something
>       goto end_double_loop;
>     }
>   end_double_loop : {}
>
>   return 0;}
>
>
> Thanks,
> Jason
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150714/4b415941/attachment.html>


More information about the cfe-dev mailing list