gribozavr2 added inline comments.
================ Comment at: clang/lib/Sema/SemaDecl.cpp:14252 + FD->getReturnType().isConstQualified()) + return FD->getReturnTypeSourceRange().getBegin().getLocWithOffset( + /*strlen("const ")=*/-6); ---------------- Could you add tests for the following cases? I'm not sure the implementation will work. ``` // Two spaces between 'const' and 'struct'. const struct MyStruct get_struct() ... const /*comment*/ struct MyStruct get_struct() ... #define MY_CONST const MY_CONST struct MyStruct get_struct() ... ``` I think a better way would be to check the token that comes before the type name, and if that token is 'const', then adjust the source location -- otherwise insert the 'static' keyword where we used to insert it in the past. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D81444/new/ https://reviews.llvm.org/D81444 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits