================
@@ -978,6 +979,28 @@ NumericLiteralParser::NumericLiteralParser(StringRef
TokSpelling,
// we break out of the loop.
for (; s != ThisTokEnd; ++s) {
switch (*s) {
+ case 'b':
+ case 'B':
+ if (!isFPConstant)
+ break; // Error for integer constant.
+ if (isBFloat16)
+ break;
+ if (!Target.hasBFloat16Type())
+ break;
----------------
overmighty wrote:
Nit: I think target support for bfloat16 should be checked first. Some of the
other `switch` cases start by checking `LangOpts`.
There's no need to check both `isBFloat16` and `HasSize`, we can just check
`HasSize`.
```suggestion
if (!Target.hasBFloat16Type())
break;
if (!isFPConstant)
break; // Error for integer constant.
```
https://github.com/llvm/llvm-project/pull/134214
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits