[PATCH] D130210: [SemaCXX] Set promotion type for enum bool to integer type.

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 21 05:51:12 PDT 2022


aaron.ballman added inline comments.


================
Comment at: clang/lib/Sema/SemaDecl.cpp:16198-16201
+        if (EnumTy->isPromotableIntegerType())
+          ED->setPromotionType(Context.getPromotedIntegerType(EnumTy));
+        else
+          ED->setPromotionType(EnumTy);
----------------



================
Comment at: clang/lib/Sema/SemaDecl.cpp:16824-16828
+      QualType EnumTy = ED->getIntegerType();
+      if (EnumTy->isPromotableIntegerType())
+        ED->setPromotionType(Context.getPromotedIntegerType(EnumTy));
+      else
+        ED->setPromotionType(EnumTy);
----------------
Same here as above


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D130210



More information about the cfe-commits mailing list