rsmith added inline comments.
Comment at: clang/lib/Frontend/InitPreprocessor.cpp:593-594
+ // C++2b features.
+ if (LangOpts.CPlusPlus2b)
+Builder.defineMacro("__cpp_size_t_suffix", "202011L");
if (LangOpts.Char8)
Quuxplusone wrote:
> AntonBikineev
Quuxplusone added inline comments.
Comment at: clang/lib/Frontend/InitPreprocessor.cpp:593-594
+ // C++2b features.
+ if (LangOpts.CPlusPlus2b)
+Builder.defineMacro("__cpp_size_t_suffix", "202011L");
if (LangOpts.Char8)
AntonBikineev wrote:
>
AntonBikineev added inline comments.
Comment at: clang/lib/Frontend/InitPreprocessor.cpp:593-594
+ // C++2b features.
+ if (LangOpts.CPlusPlus2b)
+Builder.defineMacro("__cpp_size_t_suffix", "202011L");
if (LangOpts.Char8)
Quuxplusone wrote:
>
Quuxplusone added inline comments.
Comment at: clang/lib/Frontend/InitPreprocessor.cpp:593-594
+ // C++2b features.
+ if (LangOpts.CPlusPlus2b)
+Builder.defineMacro("__cpp_size_t_suffix", "202011L");
if (LangOpts.Char8)
aaron.ballman wrote:
>
AntonBikineev closed this revision.
AntonBikineev added a comment.
Aaron, Richard, thanks a lot for reviewing this!
Sorry, forgot to add amend the commit with 'Differential revision', closing
this manually..
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.
LGTM, thank you for the patch!
Comment at: clang/lib/Frontend/InitPreprocessor.cpp:593-594
+ // C++2b features.
+ if (LangOpts.CPlusPlus2b)
+
AntonBikineev updated this revision to Diff 334422.
AntonBikineev added a comment.
Fix comment
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D99456/new/
https://reviews.llvm.org/D99456
Files:
clang/include/clang/Basic/DiagnosticCommonKinds.td
AntonBikineev marked an inline comment as done.
AntonBikineev added inline comments.
Comment at: clang/lib/Frontend/InitPreprocessor.cpp:593-594
+ // C++2b features.
+ if (LangOpts.CPlusPlus2b)
+Builder.defineMacro("__cpp_size_t_suffix", "202011L");
if (LangOpts.Char8)
aaron.ballman added a comment.
Generally LGTM but I did have a question about the feature testing macro.
Comment at: clang/lib/Frontend/InitPreprocessor.cpp:593-594
+ // C++2b features.
+ if (LangOpts.CPlusPlus2b)
+Builder.defineMacro("__cpp_size_t_suffix", "202011L");
AntonBikineev updated this revision to Diff 334288.
AntonBikineev marked 2 inline comments as done.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D99456/new/
https://reviews.llvm.org/D99456
Files:
clang/include/clang/Basic/DiagnosticCommonKinds.td
rsmith accepted this revision.
rsmith added a comment.
Thanks! Looks good to me. Please wait a day or so in case Aaron has more
comments before going ahead.
Comment at: clang/include/clang/Basic/DiagnosticCommonKinds.td:198-200
+def err_size_t_literal_too_large: Error<
+
AntonBikineev updated this revision to Diff 334263.
AntonBikineev added a comment.
Address comments
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D99456/new/
https://reviews.llvm.org/D99456
Files:
AntonBikineev marked an inline comment as done.
AntonBikineev added inline comments.
Comment at: clang/include/clang/Basic/DiagnosticCommonKinds.td:198-200
+def err_size_t_literal_too_large: Error<
+ "%select{signed |}0'size_t' literal is out of range of possible "
+
rsmith added inline comments.
Comment at: clang/include/clang/Basic/DiagnosticCommonKinds.td:198-200
+def err_size_t_literal_too_large: Error<
+ "%select{signed |}0'size_t' literal is out of range of possible "
+ "%select{signed |}0'size_t' values">;
I wonder
AntonBikineev updated this revision to Diff 334102.
AntonBikineev marked an inline comment as done.
AntonBikineev added a comment.
Address comments. Also:
- always issue a new diagnostic if size_t/ssize_t is out of range;
- prohibit numbers with 'z' suffix and non-10-radix to be interpreted as
AntonBikineev marked 3 inline comments as done.
AntonBikineev added inline comments.
Comment at: clang/lib/Lex/LiteralSupport.cpp:640
isFloat16 = true;
continue;
}
rsmith wrote:
> Looks like this might fix [[
rsmith added inline comments.
Comment at: clang/lib/Lex/LiteralSupport.cpp:640
isFloat16 = true;
continue;
}
Looks like this might fix [[ https://godbolt.org/z/9Pe4qr1c7 | incorrect
acceptance ]] of `1.0f16f` and `1.0f16L` in CUDA mode
AntonBikineev updated this revision to Diff 334037.
AntonBikineev marked 2 inline comments as done.
AntonBikineev added a comment.
Address comments
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D99456/new/
https://reviews.llvm.org/D99456
Files:
AntonBikineev marked 7 inline comments as done.
AntonBikineev added a comment.
Thanks Richard for taking a look!
Comment at: clang/include/clang/Basic/DiagnosticCommonKinds.td:190
InGroup, DefaultIgnore;
+def ext_cxx2b_size_t_suffix : Extension<
+ "'size_t' suffix for
rsmith added inline comments.
Comment at: clang/include/clang/Basic/DiagnosticCommonKinds.td:190
InGroup, DefaultIgnore;
+def ext_cxx2b_size_t_suffix : Extension<
+ "'size_t' suffix for literals is a C++2b extension">,
Should this be an `ExtWarn`? I think we
AntonBikineev updated this revision to Diff 333972.
AntonBikineev marked an inline comment as done.
AntonBikineev added a comment.
Address comments
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D99456/new/
https://reviews.llvm.org/D99456
Files:
AntonBikineev marked 9 inline comments as done.
AntonBikineev added a comment.
Thanks Aaron for taking a look! Addressed the comments. I also hope it's okay
to test preprocessor in the same test (test/Lexer/size_t-literal.cpp).
Comment at: clang/lib/Sema/SemaExpr.cpp:3911
+
aaron.ballman requested changes to this revision.
aaron.ballman added a comment.
This revision now requires changes to proceed.
Thanks for working on this! I think the direction is good in general, but I
think we should also add tests for use in the preprocessor (`#if 1z == 1`, etc)
as well as
AntonBikineev updated this revision to Diff 333811.
AntonBikineev added a comment.
Fix formatting
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D99456/new/
https://reviews.llvm.org/D99456
Files:
clang/include/clang/Basic/DiagnosticCommonKinds.td
AntonBikineev updated this revision to Diff 333681.
AntonBikineev added a comment.
Fix failing tests
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D99456/new/
https://reviews.llvm.org/D99456
Files:
AntonBikineev created this revision.
AntonBikineev added a reviewer: rsmith.
AntonBikineev requested review of this revision.
Herald added a project: clang.
This adds support for C++2b z/uz suffixes for size_t literals (P0330).
Repository:
rG LLVM Github Monorepo
26 matches
Mail list logo