[PATCH] D147989: [clang] Fix Attribute Placement

Priyanshi Agarwal via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 14 22:38:55 PDT 2023


ipriyanshi1708 added a comment.

In D147989#4257721 <https://reviews.llvm.org/D147989#4257721>, @aaron.ballman wrote:

> Thank you for working on this!
>
> The changes are missing test coverage; please be sure to add that, along with a release note about the fix. I think there's likely more work to be done here as well, considering this behavior: https://godbolt.org/z/sdK3Gef75 (notice the suggested location for the fix-it -- that also needs to be fixed for this)

Can you please provide me guidance for writing tests for enum class. As I have tried but I am not getting any idea on how to write new tests for enum class.



================
Comment at: clang/lib/Sema/SemaDecl.cpp:5041
   case DeclSpec::TST_enum:
     return 4;
   default:
----------------
jrtc27 wrote:
> Why not just always pass the full DeclSpec and handle the class case here, maybe with a bool to allow other users to not need to treat enum class as different?
Ya, we can do that too. But like GetDiagnosticTypeSpecifierID() is also called in many other places in the file so if I pass the full DeclSpec in this function will not disturb those calls?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D147989



More information about the cfe-commits mailing list