[clang] [clang-format] Improve function pointer CastRParen detection. (PR #126019)
Owen Pan via cfe-commits
cfe-commits at lists.llvm.org
Fri Feb 7 19:06:03 PST 2025
================
@@ -874,6 +874,11 @@ TEST_F(TokenAnnotatorTest, UnderstandsCasts) {
EXPECT_TOKEN(Tokens[14], tok::r_paren, TT_CastRParen);
EXPECT_TOKEN(Tokens[15], tok::amp, TT_UnaryOperator);
+ Tokens = annotate("func((foo(bar::*)(void))&a);");
----------------
owenca wrote:
So `foo` is a return type. Then the `(` that follows should be annotated as a `FunctionLParen`, and there should be a space between them like in `int (*)()`.
https://github.com/llvm/llvm-project/pull/126019
More information about the cfe-commits
mailing list