@@ -1117,6 +1118,31 @@ NumericLiteralParser::NumericLiteralParser(StringRef
TokSpelling,
if (isImaginary) break; // Cannot be repeated.
isImaginary = true;
continue; // Success.
+case '_':
+ if (isFPConstant)
+break; // Invalid for floats
@@ -1117,6 +1118,31 @@ NumericLiteralParser::NumericLiteralParser(StringRef
TokSpelling,
if (isImaginary) break; // Cannot be repeated.
isImaginary = true;
continue; // Success.
+case '_':
+ if (isFPConstant)
+break; // Invalid for floats
@@ -1117,6 +1118,31 @@ NumericLiteralParser::NumericLiteralParser(StringRef
TokSpelling,
if (isImaginary) break; // Cannot be repeated.
isImaginary = true;
continue; // Success.
+case '_':
+ if (isFPConstant)
+break; // Invalid for floats
@@ -1117,6 +1118,31 @@ NumericLiteralParser::NumericLiteralParser(StringRef
TokSpelling,
if (isImaginary) break; // Cannot be repeated.
isImaginary = true;
continue; // Success.
+case '_':
+ if (isFPConstant)
+break; // Invalid for floats
@@ -1117,6 +1118,31 @@ NumericLiteralParser::NumericLiteralParser(StringRef
TokSpelling,
if (isImaginary) break; // Cannot be repeated.
isImaginary = true;
continue; // Success.
+case '_':
+ if (isFPConstant)
+break; // Invalid for floats
@@ -1117,6 +1118,31 @@ NumericLiteralParser::NumericLiteralParser(StringRef
TokSpelling,
if (isImaginary) break; // Cannot be repeated.
isImaginary = true;
continue; // Success.
+case '_':
+ if (isFPConstant)
+break; // Invalid for floats
github-actions[bot] wrote:
@js324 Congratulations on having your first Pull Request (PR) merged into the
LLVM Project!
Your changes will be combined with recent changes from other authors, then
tested
by our [build bots](https://lab.llvm.org/buildbot/). If there is a problem with
a build, y
https://github.com/AaronBallman closed
https://github.com/llvm/llvm-project/pull/86586
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/js324 updated https://github.com/llvm/llvm-project/pull/86586
>From c822eaf87526567825e9c4403ae9f01dd4ff58a3 Mon Sep 17 00:00:00 2001
From: Jin S
Date: Mon, 25 Mar 2024 17:19:41 -0400
Subject: [PATCH 1/2] [BitInt] Expose a _BitInt literal suffix in C++
---
clang/docs/Release
erichkeane wrote:
At least the windows failure seems completely unrelated, it is a 'flang' build
failure, likely caused by you getting 'unlucky' and the build being broken at
the time. You DO have a conflict to resolve, so perhaps doing that will get
you back to green.
https://github.com/llv
js324 wrote:
Any insight on why the latest commit is failing? Is it just because of the
clang-format change?
https://github.com/llvm/llvm-project/pull/86586
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman
https://github.com/js324 updated https://github.com/llvm/llvm-project/pull/86586
>From c822eaf87526567825e9c4403ae9f01dd4ff58a3 Mon Sep 17 00:00:00 2001
From: Jin S
Date: Mon, 25 Mar 2024 17:19:41 -0400
Subject: [PATCH 1/2] [BitInt] Expose a _BitInt literal suffix in C++
---
clang/docs/Release
https://github.com/erichkeane approved this pull request.
This is fine to me, I have some concerns about the out-of-bounds reads on the
NumericLIteralParser, but if @cor3ntin and you have done the work to make sure
it is ok, than I am ok with it.
https://github.com/llvm/llvm-project/pull/86586
@@ -80,7 +80,10 @@ class NumericLiteralParser {
bool isFloat128 : 1; // 1.0q
bool isFract : 1; // 1.0hr/r/lr/uhr/ur/ulr
bool isAccum : 1; // 1.0hk/k/lk/uhk/uk/ulk
- bool isBitInt : 1;// 1wb, 1uwb (C23)
+ // clang-format off
+ bool isBitInt
https://github.com/AaronBallman approved this pull request.
Aside from a nit with clang-format commenting, LGTM! @Sirraide are you happy
with the state of things (you've got a "request changes" for your review).
@erichkeane are you happy as well?
https://github.com/llvm/llvm-project/pull/86586
https://github.com/AaronBallman edited
https://github.com/llvm/llvm-project/pull/86586
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/js324 updated https://github.com/llvm/llvm-project/pull/86586
>From c822eaf87526567825e9c4403ae9f01dd4ff58a3 Mon Sep 17 00:00:00 2001
From: Jin S
Date: Mon, 25 Mar 2024 17:19:41 -0400
Subject: [PATCH] [BitInt] Expose a _BitInt literal suffix in C++
---
clang/docs/ReleaseNote
https://github.com/js324 updated https://github.com/llvm/llvm-project/pull/86586
>From 1b0902aa9f8a07771f29fb21d7b4cdea9e966118 Mon Sep 17 00:00:00 2001
From: Jin S
Date: Mon, 25 Mar 2024 17:19:41 -0400
Subject: [PATCH 1/2] [BitInt] Expose a _BitInt literal suffix in C++
---
clang/docs/Release
@@ -1117,6 +1118,26 @@ NumericLiteralParser::NumericLiteralParser(StringRef
TokSpelling,
if (isImaginary) break; // Cannot be repeated.
isImaginary = true;
continue; // Success.
+case '_':
+ if (isFPConstant)
+break; // Invalid for floats
@@ -1127,9 +1148,9 @@ NumericLiteralParser::NumericLiteralParser(StringRef
TokSpelling,
// wb and WB are allowed, but a mixture of cases like Wb or wB is not. We
// explicitly do not support the suffix in C++ as an extension because a
// library-based UDL tha
@@ -1127,9 +1148,9 @@ NumericLiteralParser::NumericLiteralParser(StringRef
TokSpelling,
// wb and WB are allowed, but a mixture of cases like Wb or wB is not. We
// explicitly do not support the suffix in C++ as an extension because a
// library-based UDL tha
@@ -1117,6 +1118,26 @@ NumericLiteralParser::NumericLiteralParser(StringRef
TokSpelling,
if (isImaginary) break; // Cannot be repeated.
isImaginary = true;
continue; // Success.
+case '_':
+ if (isFPConstant)
+break; // Invalid for floats
@@ -1117,19 +1118,37 @@ NumericLiteralParser::NumericLiteralParser(StringRef
TokSpelling,
if (isImaginary) break; // Cannot be repeated.
isImaginary = true;
continue; // Success.
+case '_':
+ if (isFPConstant)
+break; // Invalid for floats
@@ -974,6 +974,7 @@ NumericLiteralParser::NumericLiteralParser(StringRef
TokSpelling,
bool isFixedPointConstant = isFixedPointLiteral();
bool isFPConstant = isFloatingLiteral();
bool HasSize = false;
+ bool PossibleBitInt = false;
erichkeane wrote:
I'd
@@ -1117,6 +1118,26 @@ NumericLiteralParser::NumericLiteralParser(StringRef
TokSpelling,
if (isImaginary) break; // Cannot be repeated.
isImaginary = true;
continue; // Success.
+case '_':
+ if (isFPConstant)
+break; // Invalid for floats
@@ -80,7 +80,8 @@ class NumericLiteralParser {
bool isFloat128 : 1; // 1.0q
bool isFract : 1; // 1.0hr/r/lr/uhr/ur/ulr
bool isAccum : 1; // 1.0hk/k/lk/uhk/uk/ulk
- bool isBitInt : 1;// 1wb, 1uwb (C23)
+ bool isBitInt : 1; // 1wb, 1uwb (C23)
@@ -1127,9 +1148,9 @@ NumericLiteralParser::NumericLiteralParser(StringRef
TokSpelling,
// wb and WB are allowed, but a mixture of cases like Wb or wB is not. We
// explicitly do not support the suffix in C++ as an extension because a
// library-based UDL tha
https://github.com/Sirraide edited
https://github.com/llvm/llvm-project/pull/86586
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1127,9 +1148,9 @@ NumericLiteralParser::NumericLiteralParser(StringRef
TokSpelling,
// wb and WB are allowed, but a mixture of cases like Wb or wB is not. We
// explicitly do not support the suffix in C++ as an extension because a
// library-based UDL tha
@@ -1127,9 +1148,9 @@ NumericLiteralParser::NumericLiteralParser(StringRef
TokSpelling,
// wb and WB are allowed, but a mixture of cases like Wb or wB is not. We
// explicitly do not support the suffix in C++ as an extension because a
// library-based UDL tha
https://github.com/AaronBallman commented:
The changes LGTM but I'd like to give Corentin and Tom a chance to weigh in as
lexer code owners (you may need to be patient as they were both in WG21
meetings last week and are currently on vacation, so it may be later next week
before we hear back).
@@ -1127,9 +1148,9 @@ NumericLiteralParser::NumericLiteralParser(StringRef
TokSpelling,
// wb and WB are allowed, but a mixture of cases like Wb or wB is not. We
// explicitly do not support the suffix in C++ as an extension because a
// library-based UDL tha
@@ -1127,9 +1148,9 @@ NumericLiteralParser::NumericLiteralParser(StringRef
TokSpelling,
// wb and WB are allowed, but a mixture of cases like Wb or wB is not. We
// explicitly do not support the suffix in C++ as an extension because a
// library-based UDL tha
https://github.com/js324 updated https://github.com/llvm/llvm-project/pull/86586
>From 1b0902aa9f8a07771f29fb21d7b4cdea9e966118 Mon Sep 17 00:00:00 2001
From: Jin S
Date: Mon, 25 Mar 2024 17:19:41 -0400
Subject: [PATCH] [BitInt] Expose a _BitInt literal suffix in C++
---
clang/docs/ReleaseNote
@@ -1117,6 +1118,26 @@ NumericLiteralParser::NumericLiteralParser(StringRef
TokSpelling,
if (isImaginary) break; // Cannot be repeated.
isImaginary = true;
continue; // Success.
+case '_':
+ if (isFPConstant)
+break; // Invalid for floats
@@ -1117,6 +1118,26 @@ NumericLiteralParser::NumericLiteralParser(StringRef
TokSpelling,
if (isImaginary) break; // Cannot be repeated.
isImaginary = true;
continue; // Success.
+case '_':
+ if (isFPConstant)
+break; // Invalid for floats
@@ -1117,6 +1118,26 @@ NumericLiteralParser::NumericLiteralParser(StringRef
TokSpelling,
if (isImaginary) break; // Cannot be repeated.
isImaginary = true;
continue; // Success.
+case '_':
+ if (isFPConstant)
+break; // Invalid for floats
@@ -1127,9 +1148,9 @@ NumericLiteralParser::NumericLiteralParser(StringRef
TokSpelling,
// wb and WB are allowed, but a mixture of cases like Wb or wB is not. We
// explicitly do not support the suffix in C++ as an extension because a
// library-based UDL tha
@@ -1117,6 +1118,26 @@ NumericLiteralParser::NumericLiteralParser(StringRef
TokSpelling,
if (isImaginary) break; // Cannot be repeated.
isImaginary = true;
continue; // Success.
+case '_':
+ if (isFPConstant)
+break; // Invalid for floats
https://github.com/js324 updated https://github.com/llvm/llvm-project/pull/86586
>From 3186b97752f6a6a9b065b5b63b78fc3025ed224b Mon Sep 17 00:00:00 2001
From: Jin S
Date: Mon, 25 Mar 2024 17:19:41 -0400
Subject: [PATCH 1/2] [BitInt] Expose a _BitInt literal suffix in C++
---
clang/docs/Release
https://github.com/js324 updated https://github.com/llvm/llvm-project/pull/86586
>From 3186b97752f6a6a9b065b5b63b78fc3025ed224b Mon Sep 17 00:00:00 2001
From: Jin S
Date: Mon, 25 Mar 2024 17:19:41 -0400
Subject: [PATCH] [BitInt] Expose a _BitInt literal suffix in C++
---
clang/docs/ReleaseNote
https://github.com/js324 updated https://github.com/llvm/llvm-project/pull/86586
>From 1df201fabc67e252a665338934334490e1849359 Mon Sep 17 00:00:00 2001
From: Jin S
Date: Mon, 25 Mar 2024 17:19:41 -0400
Subject: [PATCH 1/2] [BitInt] Expose a _BitInt literal suffix in C++
---
clang/docs/Release
@@ -88,6 +88,7 @@ sections with improvements to Clang's support for those
languages.
C++ Language Changes
+- Implemented _BitInt literal suffixes as ``__wb`` or ``__WB`` with unsigned
modifiers also allowed. (#GH85223).
Sirraide wrote:
@@ -88,6 +88,7 @@ sections with improvements to Clang's support for those
languages.
C++ Language Changes
+- Implemented _BitInt literal suffixes as ``__wb`` or ``__WB`` with unsigned
modifiers also allowed. (#GH85223).
AaronBallman wrot
@@ -88,6 +88,7 @@ sections with improvements to Clang's support for those
languages.
C++ Language Changes
+- Implemented _BitInt literal suffixes as ``__wb`` or ``__WB`` with unsigned
modifiers also allowed. (#GH85223).
AaronBallman wrot
@@ -1516,3 +1516,5 @@ def UnsafeBufferUsage : DiagGroup<"unsafe-buffer-usage",
[UnsafeBufferUsageInCon
// Warnings and notes InstallAPI verification.
def InstallAPIViolation : DiagGroup<"installapi-violation">;
+// Warnings related to _BitInt extension
+def BitIntExtension :
@@ -1241,7 +1260,9 @@ bool NumericLiteralParser::isValidUDSuffix(const
LangOptions &LangOpts,
return false;
// By C++11 [lex.ext]p10, ud-suffixes starting with an '_' are always valid.
- if (Suffix[0] == '_')
+ // Suffixes starting with '__' (double underscore) are fo
@@ -1117,19 +1118,37 @@ NumericLiteralParser::NumericLiteralParser(StringRef
TokSpelling,
if (isImaginary) break; // Cannot be repeated.
isImaginary = true;
continue; // Success.
+case '_':
+ if (isFPConstant)
+break; // Invalid for floats
@@ -1117,19 +1118,37 @@ NumericLiteralParser::NumericLiteralParser(StringRef
TokSpelling,
if (isImaginary) break; // Cannot be repeated.
isImaginary = true;
continue; // Success.
+case '_':
+ if (isFPConstant)
+break; // Invalid for floats
https://github.com/js324 updated https://github.com/llvm/llvm-project/pull/86586
>From 1df201fabc67e252a665338934334490e1849359 Mon Sep 17 00:00:00 2001
From: Jin S
Date: Mon, 25 Mar 2024 17:19:41 -0400
Subject: [PATCH] [BitInt] Expose a _BitInt literal suffix in C++
---
clang/docs/ReleaseNote
llvmbot wrote:
@llvm/pr-subscribers-clang
Author: None (js324)
Changes
Hi,
This PR is an attempt for #85223 to expose _BitInt literal suffixes as
an extension in C++ as `__wb`. There is a new Extension warning, and the tests
are essentially the same as the existing _BitInt literal tests
github-actions[bot] wrote:
Thank you for submitting a Pull Request (PR) to the LLVM Project!
This PR will be automatically labeled and the relevant teams will be
notified.
If you wish to, you can add reviewers by using the "Reviewers" section on this
page.
If this is not working for you, it
https://github.com/js324 created https://github.com/llvm/llvm-project/pull/86586
Hi,
This PR is an attempt for #85223 to expose _BitInt literal suffixes as an
extension in C++ as `__wb`. There is a new Extension warning, and the tests are
essentially the same as the existing _BitInt literal te
53 matches
Mail list logo