[PATCH] D156360: [clang-format] Support function and overloaded operator SpacesInParensOption

Gedare Bloom via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 1 10:43:16 PDT 2023


gedare added inline comments.


================
Comment at: clang/unittests/Format/FormatTest.cpp:16786
   verifyFormat("SomeType *__attribute__( ( attr ) ) *a = NULL;", Spaces);
-  verifyFormat("void __attribute__( ( naked ) ) foo( int bar )", Spaces);
+  verifyFormat("void __attribute__( ( x ) ) foo(int y) { return; }", Spaces);
   verifyFormat("void f() __attribute__( ( asdf ) );", Spaces);
----------------
HazardyKnusperkeks wrote:
> Why change this?
The original test is incomplete/ambiguous. It's either a declaration missing a semicolon, or it's the start of a definition. I made it a definition.


================
Comment at: clang/unittests/Format/FormatTest.cpp:16904
+  verifyFormat("call( x, y, z );", Spaces);
+  verifyFormat("call();", Spaces);
+  verifyFormat("std::function<void(int, int)> callback;", Spaces);
----------------
HazardyKnusperkeks wrote:
> Should here be a space?
That's controlled by space in empty parens.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D156360



More information about the cfe-commits mailing list