[PATCH] D41003: Silence GCC 7 warning by using an enum class.

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 11 12:35:39 PST 2018


RKSimon added inline comments.


================
Comment at: lib/Target/Hexagon/HexagonISelDAGToDAGHVX.cpp:95
 
+enum class ColorKind { None, Red, Black };
 
----------------
fhahn wrote:
> RKSimon wrote:
> > (style) Worth using a CK_ prefix?
> > 
> > ```
> > 
> > enum class ColorKind { CK_None, CK_Red, CK_Black };
> > ```
> enum classes are strongly scoped, so any access needs to be prefixed with `ColorKind::`. With that, having a CK_ prefix seems slightly redundant to me. What do you think?
https://llvm.org/docs/CodingStandards.html#name-types-functions-variables-and-enumerators-properly


https://reviews.llvm.org/D41003





More information about the llvm-commits mailing list