================ @@ -978,6 +979,24 @@ NumericLiteralParser::NumericLiteralParser(StringRef TokSpelling, // we break out of the loop. for (; s != ThisTokEnd; ++s) { switch (*s) { + case 'b': // FP Suffix for "__bf16" + case 'B': + if (!Target.hasBFloat16Type()) + break; + if (!isFPConstant) + break; // Error for integer constant. + if (HasSize) + break; + HasSize = true; + + if (s + 3 < ThisTokEnd && + ((s[0] == 'b' && s[1] == 'f') || (s[0] == 'B' && s[1] == 'F')) && + s[2] == '1' && s[3] == '6') { + s += 3; // success, eat up 3 characters. + isBFloat16 = true; + continue; + } + break; ---------------- cor3ntin wrote:
This is true for C++23. Do we want extension warnings in other language modes @AaronBallman? As an aside, did anyone benchmark that the pattern we use in this function is actually faster than string_view comparisons? https://github.com/llvm/llvm-project/pull/134214 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits