We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 26fc2e9 commit a7a0208Copy full SHA for a7a0208
flang/include/flang/Support/LangOptions.h
@@ -62,7 +62,10 @@ class LangOptions : public LangOptionsBase {
62
#define LANGOPT(Name, Bits, Default)
63
#define ENUM_LANGOPT(Name, Type, Bits, Default) \
64
Type get##Name() const { return static_cast<Type>(Name); } \
65
- void set##Name(Type Value) { Name = static_cast<unsigned>(Value); }
+ void set##Name(Type Value) { \
66
+ assert(static_cast<unsigned>(Value) < (1u << Bits)); \
67
+ Name = static_cast<unsigned>(Value); \
68
+ }
69
#include "LangOptions.def"
70
71
/// Name of the IR file that contains the result of the OpenMP target
0 commit comments