[clang] [NFC][Clang] Fix enumerated mismatch warning (PR #112816)

via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 18 06:14:50 PDT 2024


================
@@ -3150,8 +3150,8 @@ Parser::DeclGroupPtrTy Parser::ParseCXXClassMemberDeclaration(
   if (Tok.is(tok::kw_concept)) {
     Diag(Tok.getLocation(),
          DS.isFriendSpecified() || NextToken().is(tok::kw_friend)
-             ? diag::err_friend_concept
-             : diag::
+             ? (unsigned)diag::err_friend_concept
+             : (unsigned)diag::
                    err_concept_decls_may_only_appear_in_global_namespace_scope);
----------------
Sirraide wrote:

```suggestion
             ? unsigned(diag::err_friend_concept)
             : unsigned(diag::
                   err_concept_decls_may_only_appear_in_global_namespace_scope));
```
We generally try to avoid C-style casts. You might have to reformat that because idk what clang-format is gonna do w/ this.

https://github.com/llvm/llvm-project/pull/112816


More information about the cfe-commits mailing list