[PATCH] D153914: [clang-cl] Enable concatenation of predefined identifiers

2023-07-24 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added inline comments. Comment at: clang/include/clang/Basic/TokenKinds.h:87-93 +/// Return true if this token is a predefined macro +/// unexpandable by MSVC preprocessor. +inline bool isUnexpandableMsMacro(TokenKind K) { + return K == tok::kw___FUNCTION__ || K == tok:

[PATCH] D155955: [Clang] Improve the handling of large arrays evaluation.

2023-07-24 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin updated this revision to Diff 543472. cor3ntin added a comment. - Use -fconstexpr-steps to limit the size of the array. - Aply the logic to both constant evaluation and constant folding as is constant evaluation fail the limit can now be increased. Repository: rG LLVM Github Monorepo

[PATCH] D155955: [Clang] Improve the handling of large arrays evaluation.

2023-07-24 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added inline comments. Comment at: clang/lib/AST/ExprConstant.cpp:6754-6758 bool IsNothrow = false; for (unsigned I = 1, N = E->getNumArgs(); I != N; ++I) { EvaluateIgnoredValue(Info, E->getArg(I)); IsNothrow |= E->getType()->isNothrowT(); } --

[PATCH] D155175: [Clang] Fix consteval propagation for aggregates and defaulted constructors

2023-07-24 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added inline comments. Comment at: clang/test/SemaCXX/cxx2a-consteval-default-params.cpp:48 -struct InitWithLambda { -int b = [](int error = undefined()) { // expected-error {{cannot take address of consteval function 'undefined' outside of an immediate invocation

[PATCH] D155175: [Clang] Fix consteval propagation for aggregates and defaulted constructors

2023-07-24 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin updated this revision to Diff 543476. cor3ntin added a comment. - Fix FunctionDecl constness - Replan an `auto` Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D155175/new/ https://reviews.llvm.org/D155175 Files: clang/include/clang/AST/Re

[PATCH] D156042: [clang][Interp] Implement __builtin_strlen

2023-07-24 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin accepted this revision. cor3ntin added a comment. This revision is now accepted and ready to land. LGTM, modulo suggestion Comment at: clang/lib/AST/Interp/InterpBuiltin.cpp:63-69 + if (SizeTWidth == 64) +S.Stk.push>(Integral<64, false>::from(Val)); + else if (Si

[PATCH] D155955: [Clang] Improve the handling of large arrays evaluation.

2023-07-24 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin marked 2 inline comments as done. cor3ntin added inline comments. Comment at: clang/include/clang/Basic/DiagnosticASTKinds.td:356 + "cannot allocate array; evaluated array bound %0 exceeds the limit (%1); " + "use -fconstexpr-steps=%0 to increase this limit">; def not

[PATCH] D155955: [Clang] Improve the handling of large arrays evaluation.

2023-07-24 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin updated this revision to Diff 543490. cor3ntin added a comment. Address Aaron's comments and add documentation Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D155955/new/ https://reviews.llvm.org/D155955 Files: clang/docs/ReleaseNotes.rst

[PATCH] D155955: [Clang] Improve the handling of large arrays evaluation.

2023-07-24 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin updated this revision to Diff 543504. cor3ntin added a comment. Add some VLA tests Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D155955/new/ https://reviews.llvm.org/D155955 Files: clang/docs/ReleaseNotes.rst clang/docs/UsersManual.rs

[PATCH] D155955: [Clang] Improve the handling of large arrays evaluation.

2023-07-24 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin updated this revision to Diff 543530. cor3ntin added a comment. Add more Vla tests Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D155955/new/ https://reviews.llvm.org/D155955 Files: clang/docs/ReleaseNotes.rst clang/docs/UsersManual.rs

[PATCH] D155175: [Clang] Fix consteval propagation for aggregates and defaulted constructors

2023-07-24 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin updated this revision to Diff 543545. cor3ntin added a comment. Rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D155175/new/ https://reviews.llvm.org/D155175 Files: clang/include/clang/AST/RecursiveASTVisitor.h clang/include/clang

[PATCH] D155175: [Clang] Fix consteval propagation for aggregates and defaulted constructors

2023-07-24 Thread Corentin Jabot via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG8698262a4365: [Clang] Fix consteval propagation for aggregates and defaulted constructors (authored by cor3ntin). Repository: rG LLVM Github Monor

[PATCH] D155955: [Clang] Improve the handling of large arrays evaluation.

2023-07-24 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added a comment. In D155955#4528571 , @efriedma wrote: > The UINT_MAX thing seems like a straightforward bug; if we have time to fix > it properly, I'd prefer not to add weird workarounds. Note sure what you mean. Making sure we use `size_t` fo

[PATCH] D155955: [Clang] Improve the handling of large arrays evaluation.

2023-07-24 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin updated this revision to Diff 543606. cor3ntin added a comment. Update release notes and commit message Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D155955/new/ https://reviews.llvm.org/D155955 Files: clang/docs/ReleaseNotes.rst clan

[PATCH] D153914: [clang-cl] Enable concatenation of predefined identifiers

2023-07-24 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added inline comments. Comment at: clang/lib/Sema/SemaExpr.cpp:2010-2013 +OS << "R\"EFLPM(" + << PredefinedExpr::ComputeName(getPredefinedExprKind(Tok.getKind()), + currentDecl) + << ")EFLPM\""; tahone

[PATCH] D156053: [Clang] Fix crash in CIndex, when visiting a static_assert without message

2023-07-25 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added a comment. In D156053#4531015 , @kiloalphaindia wrote: > The test is no more using any includes now. Hopefully this fixes it, > otherwise I will have to add something that prints the diagnostic. > > I don't have write permissions on the r

[PATCH] D152003: [clang] Fix `static_cast` to array of unknown bound

2023-07-25 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added a comment. This looks reasonable to me know. should we try to land that today? Sorry i could not get to it earlier! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D152003/new/ https://reviews.llvm.org/D152003

[PATCH] D156053: [Clang] Fix crash in CIndex, when visiting a static_assert without message

2023-07-25 Thread Corentin Jabot via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG86da763ab6ed: [Clang] Fix crash in CIndex, when visiting a static_assert without message (authored by kiloalphaindia, committed by cor3ntin). Repos

[PATCH] D156224: [Clang] use unsigned integer constants in unit-test | fixes build error on ppc64le-lld-multistage-test

2023-07-25 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added a subscriber: aaron.ballman. cor3ntin added a comment. Thanks for the quick fix. Any idea why it would only show up on ppc64 @aaron.ballman ? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D156224/new/ https://reviews.llvm.org/D156224

[PATCH] D156224: [Clang] use unsigned integer constants in unit-test | fixes build error on ppc64le-lld-multistage-test

2023-07-25 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin accepted this revision. cor3ntin added a comment. This revision is now accepted and ready to land. I was able to confirm on my machine that the warnings are no longer emitted. They were there when i committed the initial patch, i just missed them. Sorry about that Repository: rG LLV

[PATCH] D156224: [Clang] use unsigned integer constants in unit-test | fixes build error on ppc64le-lld-multistage-test

2023-07-25 Thread Corentin Jabot via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGd0b54bb50e51: [Clang] use unsigned integer constants in unit-test | fixes build error on… (authored by kiloalphaindia, committed by cor3ntin). Repo

[PATCH] D156237: Complete the implementation of P2361 Unevaluated string literals

2023-07-25 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin created this revision. Herald added a reviewer: aaron.ballman. Herald added a subscriber: jdoerfert. Herald added a project: All. cor3ntin requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. The attributes changes were left out of Clan

[PATCH] D155707: [clang][Interp] Handle CXXNoexceptExprs

2023-07-25 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin accepted this revision. cor3ntin added a comment. This revision is now accepted and ready to land. LGTM, thanks CHANGES SINCE LAST ACTION https://reviews.llvm.org/D155707/new/ https://reviews.llvm.org/D155707 ___ cfe-commits mailing list c

[PATCH] D152003: [clang] Fix `static_cast` to array of unknown bound

2023-07-25 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added a comment. I think getting a smaller reproducer would be useful indeed before talking about conformance, even though i think there is indeed something wrong there - an incomplete parameter should not be able to produce a valid call. Repository: rG LLVM Github Monorepo CHANGES

[PATCH] D155955: [Clang] Improve the handling of large arrays evaluation.

2023-07-25 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added a comment. In D155955#4532385 , @aaron.ballman wrote: > In D155955#4528792 , @efriedma > wrote: > >>> Note sure what you mean. Making sure we use size_t for all array extents is >>> not something

[PATCH] D156247: [Clang] Add a warning on uses of coroutine keywords

2023-07-25 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added a comment. We usually reserve these warnings for feature backported to older c++ standards, and I'm not sure "you are using a standard feature" is in general a useful warning. however, if there are important unresolved issues, why did we set `__cpp_impl_coroutine` ? Repository:

[PATCH] D156027: [clang][Interp] Rework how initializers work

2023-07-25 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added a comment. In D156027#4534090 , @tbaeder wrote: > Note that this patch also supercedes: > > 1. https://reviews.llvm.org/D153616 > 2. https://reviews.llvm.org/D153653 > 3. https://reviews.llvm.org/D147591 > > since it handles those cases mor

[PATCH] D155955: [Clang] Improve the handling of large arrays evaluation.

2023-07-26 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added a comment. @efriedma You still have objection to landing that now with the goal to backport later in the release process? Thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D155955/new/ https://reviews.llvm.org/D155955 __

[PATCH] D156247: [Clang] Add a warning on uses of coroutine keywords

2023-07-26 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added a comment. In D156247#4534645 , @ilya-biryukov wrote: > Thanks for the quick feedback! > I understand that this goes against common practice in Clang, but the reason > we want this warning is very practical. > > At Google, we would like t

[PATCH] D156247: [Clang] Add a warning on uses of coroutine keywords

2023-07-26 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added a comment. If there is consensus we need to do _something_, I would prefer that solution as well Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D156247/new/ https://reviews.llvm.org/D156247 ___

[PATCH] D156064: [SemaCXX] Recognise initializer_list injected-class-name types as initializer_lists

2023-07-27 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin accepted this revision. cor3ntin added a comment. This revision is now accepted and ready to land. LGTM, thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D156064/new/ https://reviews.llvm.org/D156064 __

[PATCH] D156064: [SemaCXX] Recognise initializer_list injected-class-name types as initializer_lists

2023-07-27 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added inline comments. Comment at: clang/docs/ReleaseNotes.rst:111 +- Fix CTAD for ``std::initializer_list``. This allows + ``std::initializer_list{1, 2, 3}`` to be a ``std::initializer_list`` + as intended. Repository: rG LLVM Github Monorepo CH

[PATCH] D156212: [clang][Interp] Implement remaining strcmp builtins

2023-07-27 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added inline comments. Comment at: clang/lib/AST/Interp/InterpBuiltin.cpp:88-92 + if (!AT->getElementType()->isCharType() && + !AT->getElementType()->isChar8Type()) +return false; + + return true; aaron.ballman wrote: > Allowing `char8_t` seem

[PATCH] D156047: [clang][Interp] Handle CXXParenListInitExprs

2023-07-27 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added inline comments. Comment at: clang/lib/AST/Interp/ByteCodeExprGen.cpp:661 assert(E->getNumInits() == 1); return DiscardResult ? this->discard(E->inits()[0]) : this->visit(E->inits()[0]); how could DiscardResult e

[PATCH] D155955: [Clang] Improve the handling of large arrays evaluation.

2023-07-27 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added a comment. In D155955#4537145 , @efriedma wrote: > The general approach seems fine. The multiplier for constexpr vs. constant > folding can be left for a followup, and we can continue to consider other > possible improvements elsewhere.

[PATCH] D155457: [clang] Skip tautological comparison if the comparison involves the 'size_t' type

2023-07-27 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added inline comments. Comment at: clang/lib/Sema/SemaChecking.cpp:13807-13815 + // Don't warn if the comparison involves integral or floating-point types with + // the same canonical types. + QualType LHSCanonical = Constant->getType().getCanonicalType(); + QualTyp

[PATCH] D156047: [clang][Interp] Handle CXXParenListInitExprs

2023-07-27 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin accepted this revision. cor3ntin added a comment. This revision is now accepted and ready to land. LGTM, thanks! But please look at the bot failures, i suppose you need to rebase before merging. Also, can you try to add the new interpreter to `test/SemaCXX/paren-list-agg-init.cpp` ? C

[PATCH] D156247: [Clang] Add a warning on uses of coroutine keywords

2023-07-27 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added a comment. In D156247#4534645 , @ilya-biryukov wrote: > At Google, we would like to postpone adoption of coroutines until the > aforementioned bugs are fixed, but we feel that Clang 17 would be a good > candidate to enable other C++20 fe

[PATCH] D156237: Complete the implementation of P2361 Unevaluated string literals

2023-07-27 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin marked 2 inline comments as done. cor3ntin added inline comments. Comment at: clang/include/clang/Basic/DiagnosticCommonKinds.td:60 + "'external_source_symbol' attribute|" + "as argument of '%1' attribute}0">; + aaron.ballman wrote: > T

[PATCH] D152495: [Clang][SemaCXX] Add unused warning for variables declared in condition expressions

2023-07-27 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin accepted this revision. cor3ntin added a comment. This revision is now accepted and ready to land. LGTM, thanks. Make sure you rebase the changes to the release notes CHANGES SINCE LAST ACTION https://reviews.llvm.org/D152495/new/ https://reviews.llvm.org/D152495 ___

[PATCH] D156237: Complete the implementation of P2361 Unevaluated string literals

2023-07-27 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin updated this revision to Diff 544759. cor3ntin added a comment. Update commit message and remove spurious changes Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D156237/new/ https://reviews.llvm.org/D156237 Files: clang/docs/ReleaseNotes.

[PATCH] D155955: [Clang] Improve the handling of large arrays evaluation.

2023-07-27 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added a comment. In D155955#4539698 , @efriedma wrote: > That's scary: it means we can silently behave differently from other > compilers in a way that's hard to understand. Is there some way we can > provide a diagnostic? > > That said, it lo

[PATCH] D156237: Complete the implementation of P2361 Unevaluated string literals

2023-07-27 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin updated this revision to Diff 544890. cor3ntin edited the summary of this revision. cor3ntin added a comment. Fix typo, remove dead code Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D156237/new/ https://reviews.llvm.org/D156237 Files: c

[PATCH] D157201: [Clang] Support qualified name as member designator in offsetof

2023-08-10 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added inline comments. Comment at: clang/test/SemaCXX/offsetof.cpp:106 +int x3[__builtin_offsetof(struct X2, X2::static_a) == 0 ? 1 : -1]; // expected-error{{no member named 'static_a'}} +int x4[__builtin_offsetof(struct X2, X2::X2) == 0 ? 1 : -1]; // expected-error{{n

[PATCH] D140828: [C++] Implement "Deducing this" (P0847R7)

2023-08-10 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin marked 9 inline comments as done. cor3ntin added inline comments. Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:7280 + "a %select{function|lambda}0 with an explicit object parameter cannot " + "%select{be const|be mutable|have reference qualifiers|be vol

[PATCH] D140828: [C++] Implement "Deducing this" (P0847R7)

2023-08-10 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added inline comments. Comment at: clang/lib/Sema/SemaDeclCXX.cpp:18171 +bool Sema::CheckOverridingExplicitObjectMembers(CXXMethodDecl *New, +const CXXMethodDecl *Old) { aaron.ballman wrote: > This functi

[PATCH] D140828: [C++] Implement "Deducing this" (P0847R7)

2023-08-11 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin marked 2 inline comments as done. cor3ntin added inline comments. Comment at: clang/lib/Sema/SemaExprCXX.cpp:4330-4331 +ExprResult Res = FixOverloadedFunctionReference(From, Found, Fn); +if (Res.isInvalid()) + return ExprError(); cor3ntin

[PATCH] D156237: Complete the implementation of P2361 Unevaluated string literals

2023-08-11 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin updated this revision to Diff 549314. cor3ntin added a comment. Rebase, add C tests Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D156237/new/ https://reviews.llvm.org/D156237 Files: clang/docs/ReleaseNotes.rst clang/include/clang/Basi

[PATCH] D155081: Specify the developer policy around links to external resources

2023-08-11 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin accepted this revision. cor3ntin added a comment. This seems very reasonable to me Comment at: llvm/docs/DeveloperPolicy.rst:264 +#. Ensure that links in source code and test files are to publicly available + resources and are used primarily to add additional infor

[PATCH] D155610: [Clang][Sema] Fix display of characters on static assertion failure

2023-08-12 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added inline comments. Comment at: clang/lib/Sema/SemaDeclCXX.cpp:16899 + uint32_t CodePoint = static_cast(V.getInt().getZExtValue()); + PrintCharLiteralPrefix(BTy->getKind(), OS); + OS << '\''; hubert.reinterpretcast wrote: >

[PATCH] D156237: Complete the implementation of P2361 Unevaluated string literals

2023-08-12 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin updated this revision to Diff 549584. cor3ntin marked 8 inline comments as done. cor3ntin added a comment. Address Hubert's feedback. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D156237/new/ https://reviews.llvm.org/D156237 Files: clan

[PATCH] D157747: Support Unicode Microsoft predefined macros

2023-08-12 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added a comment. This does not appear to be valid under MSVC and I don't think we should support features that MS does not (Nor can i find any documentation that it ought to work) https://godbolt.org/z/7Te3YYeb9 Supporting the same concatenation behavior MSVC does have seem like a clea

[PATCH] D156237: Complete the implementation of P2361 Unevaluated string literals

2023-08-14 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin updated this revision to Diff 549878. cor3ntin marked an inline comment as done. cor3ntin added a comment. Address Hubert's feedback Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D156237/new/ https://reviews.llvm.org/D156237 Files: clang

[PATCH] D156237: Complete the implementation of P2361 Unevaluated string literals

2023-08-14 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added inline comments. Comment at: clang/lib/Parse/ParseDecl.cpp:431-436 +if (Expr.isInvalid()) { + SawError = true; + break; +} else { + Exprs.push_back(Expr.get()); +} hubert.reinterpretcast wrote: > cor3ntin wrote: > > aaron

[PATCH] D155610: [Clang][Sema] Fix display of characters on static assertion failure

2023-08-14 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added inline comments. Comment at: clang/lib/Sema/SemaDeclCXX.cpp:16869 +/// The code point needs to be zero-extended to 32-bits. +void ConvertCharToString(uint32_t CodePoint, const BuiltinType *BTy, + unsigned TyWidth, llvm::raw_ostream &OS) { --

[PATCH] D156237: Complete the implementation of P2361 Unevaluated string literals

2023-08-15 Thread Corentin Jabot via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG98322d3eb431: Complete the implementation of P2361 Unevaluated string literals (authored by cor3ntin). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D156237/n

[PATCH] D156032: Implement CWG2137 (list-initialization from objects of the same type)

2023-08-15 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added inline comments. Comment at: clang/test/CXX/drs/dr23xx.cpp:50 +namespace dr2311 { +#if __cplusplus >= 201707L aaron.ballman wrote: > MitalAshok wrote: > > cor3ntin wrote: > > > the dr status html page is generated automatically by leaving a magic

[PATCH] D158069: [clang][Interp] Fix getIndex() for composite array elements

2023-08-16 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added inline comments. Comment at: clang/lib/AST/Interp/Context.h:88 + /// Returns the program. This is only needed for unittests. + Program &getProgram() const { return *P.get(); } + This should return a const ref Comment at: clang/

[PATCH] D158145: [clang] Update NumFunctionDeclBits for FunctionDeclBitfields

2023-08-16 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added a comment. For context this seems to be the patch that did not increment the bit field https://reviews.llvm.org/D139837 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D158145/new/ https://reviews.llvm.org/D158145

[PATCH] D158145: [clang] Update NumFunctionDeclBits for FunctionDeclBitfields

2023-08-16 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added a comment. Thanks for working on this! Looks good to me except for a couple typos. Can you an an entry in `clang/docs/ReleaseNotes.rst` (mentioning the github issue) Comment at: clang/unittests/AST/ASTImporterTest.cpp:7836 +TEST_P(ASTImporterOptionSpecificTestBa

[PATCH] D155627: [clang][Interp] Handle SourceLocExprs

2023-08-17 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added a comment. @tbaeder Maybe you could land the dependencies of this patch so that we can progress it. Thanks! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D155627/new/ https://reviews.llvm.org/D155627 ___ cfe-commits mailing lis

[PATCH] D157596: [clang][Interp] Handle mixed floating/integral compound assign operators

2023-08-17 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added inline comments. Comment at: clang/lib/AST/Interp/ByteCodeExprGen.cpp:2676 + +if (ToT == PT_Float) { + const llvm::fltSemantics *ToSem = &Ctx.getFloatSemantics(ToQT); Might as well leave a comment here too, for symmetry CHANGES SINCE LA

[PATCH] D158145: [clang] Update NumFunctionDeclBits for FunctionDeclBitfields

2023-08-17 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added a comment. In D158145#4594549 , @danix800 wrote: > I also investigated whether we could count those bits at compile time and > statically assert on them, > because a small typo or missed update could spend us a lot of time to dig for > th

[PATCH] D140828: [C++] Implement "Deducing this" (P0847R7)

2023-08-17 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added inline comments. Comment at: clang/include/clang/Sema/Sema.h:3775 bool UseMemberUsingDeclRules, bool ConsiderCudaAttrs = true, - bool ConsiderRequiresClauses = true); + bool UseOverrideRules = false); -

[PATCH] D157201: [Clang] Support qualified name as member designator in offsetof

2023-08-19 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added inline comments. Comment at: clang/test/SemaCXX/offsetof.cpp:106 +int x3[__builtin_offsetof(struct X2, X2::static_a) == 0 ? 1 : -1]; // expected-error{{no member named 'static_a'}} +int x4[__builtin_offsetof(struct X2, X2::X2) == 0 ? 1 : -1]; // expected-error{{n

[PATCH] D158372: [Clang] Treat invalid UDL as two tokens

2023-08-21 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added inline comments. Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:9322 def warn_user_literal_reserved : Warning< - "user-defined literal suffixes %select{|not starting with '_'|containing '__'}0 are reserved" - "%select{; no literal will invoke this

[PATCH] D153701: [Clang] Implement P2718R0 "Lifetime extension in range-based for loops"

2023-08-21 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added a comment. I'm really not qualified to give you meaningful feedback on design here, but I spotted a few minor things that can be improved, I hope it helps! Comment at: clang/include/clang/Sema/Sema.h:1357 +/// Whether rewrite the default argument. +bool

[PATCH] D158433: [Clang] Do not change the type of captured vars when checking lambda constraints

2023-08-21 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin created this revision. Herald added a subscriber: ChuanqiXu. Herald added a project: All. cor3ntin requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. When checking the constraint of a lambda, we need to respect the constness of the ca

[PATCH] D158433: [Clang] Do not change the type of captured vars when checking lambda constraints

2023-08-22 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added inline comments. Comment at: clang/lib/Sema/SemaConcept.cpp:722 +const_cast(cast(FD))); +// Captures are not checked from within the lambda. +LSI->AfterParameterList = false; shafik wrote: > This comment does not really explain to m

[PATCH] D158433: [Clang] Do not change the type of captured vars when checking lambda constraints

2023-08-22 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin updated this revision to Diff 552329. cor3ntin added a comment. Improve comment Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D158433/new/ https://reviews.llvm.org/D158433 Files: clang/include/clang/Sema/Sema.h clang/lib/Sema/SemaConce

[PATCH] D158502: [clang][Interp] Actually consider ConstantExpr result

2023-08-22 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added inline comments. Comment at: clang/lib/AST/Interp/ByteCodeExprGen.cpp:767-772 + std::optional T = classify(E->getType()); + if (T && E->hasAPValueResult() && + this->visitAPValue(E->getAPValueResult(), *T, E)) +return true; + return this->delegate(E->

[PATCH] D158591: Add support of Windows Trace Logging macros

2023-08-23 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added inline comments. Comment at: clang/lib/Sema/Sema.cpp:1495-1499 + DeclContext *DC = CurContext; + while (DC && !isa(DC) && !isa(DC) && + !isa(DC) && !isa(DC)) +DC = DC->getParent(); + return dyn_cast_or_null(DC); I think this is reimp

[PATCH] D158601: [Clang] Always constant-evaluate operands of comparisons to nullptr

2023-08-23 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin created this revision. Herald added a project: All. cor3ntin requested review of this revision. Herald added subscribers: cfe-commits, wangpc. Herald added a project: clang. even if we know what the result is going to be. There may be side effects we ought not to ignore, Fixes #64923 R

[PATCH] D158433: [Clang] Do not change the type of captured vars when checking lambda constraints

2023-08-23 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added a comment. @aaron.ballman Should we land that? it already missed rc3... Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D158433/new/ https://reviews.llvm.org/D158433 ___ cfe-commits mailing l

[PATCH] D158591: Add support of Windows Trace Logging macros

2023-08-23 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added inline comments. Comment at: clang/lib/Sema/Sema.cpp:1495-1499 + DeclContext *DC = CurContext; + while (DC && !isa(DC) && !isa(DC) && + !isa(DC) && !isa(DC)) +DC = DC->getParent(); + return dyn_cast_or_null(DC); RIscRIpt wrote: > cor

[PATCH] D158601: [Clang] Always constant-evaluate operands of comparisons to nullptr

2023-08-23 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added inline comments. Comment at: clang/lib/AST/ExprConstant.cpp:13312 +!EvaluatePointer(E->getRHS(), Res, Info)) + return false; return Success(CmpResult::Equal, E); tbaeder wrote: > I kinda expected the fix for this bug to simply //r

[PATCH] D155548: [clang][ExprConst] Short-circuit ConstantExpr evaluation

2023-10-07 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin accepted this revision. cor3ntin added a comment. This revision is now accepted and ready to land. @aaron.ballman Given the recent discussion we had on both github (https://github.com/llvm/llvm-project/pull/66203) and privately, I'm going to accept that. We only create ConstantExpr for

[PATCH] D159351: [Sema] Change order of displayed overloads in diagnostics

2023-10-10 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added a subscriber: aaron.ballman. cor3ntin added a comment. + @aaron.ballman Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D159351/new/ https://reviews.llvm.org/D159351 ___ cfe-commits mailing l

[PATCH] D156212: [clang][Interp] Implement remaining strcmp builtins

2023-10-10 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added a comment. There are still unaddressed comment here. It would be nice to complete this before phab shuts down Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D156212/new/ https://reviews.llvm.org/D156212 __

[PATCH] D156518: Fix handling of medial hyphens in Unicode Names.

2023-07-28 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin created this revision. Herald added subscribers: mstorsjo, hiraditya, dschuff. Herald added a project: All. cor3ntin requested review of this revision. Herald added projects: clang, LLVM. Herald added subscribers: llvm-commits, cfe-commits. In a Unicode name was stored in a way that cause

[PATCH] D156518: Fix handling of medial hyphens in Unicode Names.

2023-07-28 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin updated this revision to Diff 545078. cor3ntin added a comment. Fix comment Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D156518/new/ https://reviews.llvm.org/D156518 Files: clang/docs/ReleaseNotes.rst clang/lib/Lex/LiteralSupport.cpp

[PATCH] D105759: Implement P2361 Unevaluated string literals

2023-07-28 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added a comment. In D105759#4540716 , @hubert.reinterpretcast wrote: >> I hope this patch may allow to gather some data on that. > > @cor3ntin, I have reports that applications having encoding prefixes in > `static_assert` are failing to build.

[PATCH] D156247: [Clang] Add a warning on uses of coroutine keywords

2023-07-28 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added a comment. How does a -cc1 flag alleviate the burden concerns for libc++? It would still be something they would have to support, unless we plan to remove the flag before c++26 and you are happy with the inclusion of `` and `` producing subpar errors. However, in the C++26 cycle,

[PATCH] D156503: [clang][Interp] Don't assume throw stmts have a subexpr

2023-07-28 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin accepted this revision. cor3ntin added a comment. This revision is now accepted and ready to land. This one was easy! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D156503/new/ https://reviews.llvm.org/D156503 _

[PATCH] D155955: [Clang] Improve the handling of large arrays evaluation.

2023-07-28 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added a subscriber: rsmith. cor3ntin added a comment. @efriedma I sent a mail to core last night, some discussion is happening. @rsmith made some good point so hopefully we will be able to produce some hard error in that case, But given this is preexisting, I'm going to land that and h

[PATCH] D156415: [NFC][analyzer] Fix static analyzer concerns

2023-07-28 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin accepted this revision. cor3ntin added a comment. This revision is now accepted and ready to land. LGTM Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D156415/new/ https://reviews.llvm.org/D156415 ___

[PATCH] D155955: [Clang] Improve the handling of large arrays evaluation.

2023-07-28 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin updated this revision to Diff 545099. cor3ntin edited the summary of this revision. cor3ntin added a comment. Rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D155955/new/ https://reviews.llvm.org/D155955 Files: clang/docs/ReleaseNot

[PATCH] D156237: Complete the implementation of P2361 Unevaluated string literals

2023-07-28 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added inline comments. Comment at: clang/lib/Parse/ParseDecl.cpp:431-436 +if (Expr.isInvalid()) { + SawError = true; + break; +} else { + Exprs.push_back(Expr.get()); +} aaron.ballman wrote: > Oups, sorry @Fznamznon, I'll fix

[PATCH] D155955: [Clang] Improve the handling of large arrays evaluation.

2023-07-28 Thread Corentin Jabot via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG45ab2b48bd55: [Clang] Improve the handling of large arrays evaluation. (authored by cor3ntin). Repository: rG LLVM Github Monorepo CHANGES SINCE

[PATCH] D156518: Fix handling of medial hyphens in Unicode Names.

2023-07-28 Thread Corentin Jabot via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG68410fbed769: Fix handling of medial hyphens in Unicode Names. (authored by cor3ntin). Changed prior to commit: https://reviews.llvm.org/D156518?v

[PATCH] D156518: Fix handling of medial hyphens in Unicode Names.

2023-07-28 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added inline comments. Comment at: llvm/utils/UnicodeData/UnicodeNameMappingGenerator.cpp:100 +for (auto ChIt = Name.begin(); ChIt != Name.end(); + ChIt += IsBeforeMedial ? 3 : 1) { + char Ch = *ChIt; aaron.ballman wrote: > Parens here m

[PATCH] D156542: [Clang] Fix constexpr alloc tests on 32 bits platforms

2023-07-28 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin created this revision. Herald added a project: All. cor3ntin requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Some bots were broken by 45ab2b48bd55 Repository:

[PATCH] D156542: [Clang] Fix constexpr alloc tests on 32 bits platforms

2023-07-28 Thread Corentin Jabot via Phabricator via cfe-commits
This revision was not accepted when it landed; it landed in state "Needs Review". This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGcdfb3d93e394: [Clang] Fix constexpr alloc tests on 32 bits platfor

[PATCH] D155955: [Clang] Improve the handling of large arrays evaluation.

2023-07-28 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added a comment. In D155955#4542531 , @antmo wrote: > Hi, clang-armv8-quick bot now fails on > Clang::cxx2a-constexpr-dynalloc-limits.cpp > > https://lab.llvm.org/buildbot/#/builders/245/builds/11764 > > Could you please look at this ? I land

[PATCH] D155955: [Clang] Improve the handling of large arrays evaluation.

2023-07-28 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added a comment. It seems to have done the trick! https://lab.llvm.org/buildbot/#/builders/245/builds/11766 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D155955/new/ https://reviews.llvm.org/D155955 __

[PATCH] D155064: [clang][SemaCXX] Diagnose tautological uses of consteval if and is_constant_evaluated

2023-07-28 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added inline comments. Comment at: clang/test/SemaCXX/vartemplate-lambda.cpp:17 +// expected-note{{cannot be used in a constant expression}} \ +// expected-er

[PATCH] D155627: [clang][Interp] Handle SourceLocExprs

2023-07-28 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added a comment. FYI i think this is fine but I'm waiting for progress on the PRs that would allow us to enable more tests. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D155627/new/ https://reviews.llvm.org/D155627 ___ cfe-commits m

[PATCH] D105759: Implement P2361 Unevaluated string literals

2023-07-28 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added a comment. In D105759#4543685 , @hubert.reinterpretcast wrote: > In D105759#4543246 , @aaron.ballman > wrote: > >> I'd recommend we change the diagnostic to be a warning that defaults to an >> er

[PATCH] D156596: [Clang] Produce a warning instead of an error in unevaluated strings before C++26

2023-07-29 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin created this revision. Herald added a project: All. cor3ntin requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D156596 Files: clang/include/clang/Basic/DiagnosticLexK

[PATCH] D156597: [Clang] Handle static_assert messages with an expression started by a literal

2023-07-29 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin created this revision. Herald added a project: All. cor3ntin requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D156597 Files: clang/lib/Parse/ParseDeclCXX.cpp clang

<    4   5   6   7   8   9   10   11   12   13   >