diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-06-22 10:21:21 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-06-28 10:47:34 +0200 |
commit | bfc1600c6ade6f006eb774bffe7caa9c948e8603 (patch) | |
tree | c660fa18fc6a9e5f05c3cc58fa34411cdc4f4257 /compilerplugins/clang/test | |
parent | f9514beb9bfed51aee69227797e74504afed31c6 (diff) |
loplugin:indentation improve checks for brace alignment
Change-Id: I333100fda7e181f68f36b03279b3fbb8cb768310
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117615
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'compilerplugins/clang/test')
-rw-r--r-- | compilerplugins/clang/test/indentation.cxx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/compilerplugins/clang/test/indentation.cxx b/compilerplugins/clang/test/indentation.cxx index e0e25884eebb..8ef6d2c03653 100644 --- a/compilerplugins/clang/test/indentation.cxx +++ b/compilerplugins/clang/test/indentation.cxx @@ -48,6 +48,16 @@ void top1(int x) { } if (x) + { // expected-note {{start brace here [loplugin:indentation]}} + foo(); + } // expected-error {{start and end brace not aligned [loplugin:indentation]}} + + if (x) // expected-note {{statement beginning here [loplugin:indentation]}} + { // expected-error {{start brace not aligned with beginning of parent statement [loplugin:indentation]}} + foo(); + } + + if (x) ; else foo(); // expected-error {{else body should be indented [loplugin:indentation]}} |