[PATCH] D103395: PR45879: Keep evaluated expression in LValue object

2022-02-04 Thread Louis Dionne via Phabricator via cfe-commits
ldionne added a comment. @rsmith Thanks a bunch! And thanks @sepavloff for trying out this approach too. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103395/new/ https://reviews.llvm.org/D103395 ___

[PATCH] D103395: PR45879: Keep evaluated expression in LValue object

2022-02-03 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff abandoned this revision. sepavloff added a comment. @rsmith, thank you! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103395/new/ https://reviews.llvm.org/D103395 ___ cfe-commits mailing list

[PATCH] D103395: PR45879: Keep evaluated expression in LValue object

2022-02-02 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added a comment. Alternative fix landed in rG30baa5d2a450d5e302d8cba3fc7a26a59d4b7ae1 . Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103395/new/

[PATCH] D103395: PR45879: Keep evaluated expression in LValue object

2022-02-02 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added inline comments. Comment at: clang/lib/AST/ExprConstant.cpp:1549 SubobjectDesignator Designator; +const Expr *LExpr = nullptr; bool IsNullPtr : 1; I don't think this is an appropriate approach. A source expression is fundamentally not

[PATCH] D103395: PR45879: Keep evaluated expression in LValue object

2022-02-02 Thread Louis Dionne via Phabricator via cfe-commits
ldionne added a comment. Hello, I know I'm not helping move this patch along because I'm not the right person to review this. However, I'd like to kindly reiterate that fixing this would be helpful for libc++. I just had to re-XFAIL one of our tuple tests because of this :-) Repository: rG

[PATCH] D103395: PR45879: Keep evaluated expression in LValue object

2022-01-13 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. P1330R0 (https://wg21.link/P1330R0) allowed changing the active member of a union in constexpr expressions. To implement it the Constant Evaluator starting from https://github.com/llvm/llvm-project/commit/31c69a3d6363463c08b86914c0c8cfc5c929c37e checks if an

[PATCH] D103395: PR45879: Keep evaluated expression in LValue object

2021-11-12 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. In D103395#3105677 , @tambre wrote: > In D103395#3105668 , @sepavloff > wrote: > >> Strange, I see that it cannot be compiled neither by gcc nor by clang: >>

[PATCH] D103395: PR45879: Keep evaluated expression in LValue object

2021-11-12 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 386823. sepavloff added a comment. Update the patch - Use more careful check for LHS expression, - Make a bit more precise LHS expression tracking, - Add comments, - Add the test from discussion. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

[PATCH] D103395: PR45879: Keep evaluated expression in LValue object

2021-11-03 Thread Raul Tambre via Phabricator via cfe-commits
tambre added a comment. In D103395#3105668 , @sepavloff wrote: > Strange, I see that it cannot be compiled neither by gcc nor by clang: > https://godbolt.org/z/1dY9Gs6zM. Do I miss something? Sorry, should've been more specific. Try in C++20 mode:

[PATCH] D103395: PR45879: Keep evaluated expression in LValue object

2021-11-03 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. Thank you for feedback! In D103395#3096177 , @tambre wrote: > This breaks the following code: > > struct sub > { > char data; > }; > > struct main > { > constexpr main() > { >

[PATCH] D103395: PR45879: Keep evaluated expression in LValue object

2021-11-03 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 384386. sepavloff added a comment. Updated patch Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103395/new/ https://reviews.llvm.org/D103395 Files: clang/lib/AST/ExprConstant.cpp

[PATCH] D103395: PR45879: Keep evaluated expression in LValue object

2021-10-29 Thread Raul Tambre via Phabricator via cfe-commits
tambre added a comment. This breaks the following code: struct sub { char data; }; struct main { constexpr main() { member = {}; } sub member; }; constexpr main a{}; With: fmt.cpp:16:16: error: constexpr variable

[PATCH] D103395: PR45879: Keep evaluated expression in LValue object

2021-10-28 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a reviewer: aaron.ballman. aaron.ballman added a comment. Trying to help get this review going again as it impacts libc++. Comment at: clang/lib/AST/ExprConstant.cpp:1584-1585 Designator = SubobjectDesignator(getType(B)); + if (!LExpr) +

[PATCH] D103395: PR45879: Keep evaluated expression in LValue object

2021-07-28 Thread Louis Dionne via Phabricator via cfe-commits
ldionne added a comment. Gentle ping. I can't review this, but if someone can, it would be awesome. https://bugs.llvm.org/show_bug.cgi?id=45879 is breaking some libc++ tests. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103395/new/

[PATCH] D103395: PR45879: Keep evaluated expression in LValue object

2021-07-12 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 357988. sepavloff added a comment. Rebased patch Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103395/new/ https://reviews.llvm.org/D103395 Files: clang/lib/AST/ExprConstant.cpp

[PATCH] D103395: PR45879: Keep evaluated expression in LValue object

2021-05-31 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff created this revision. sepavloff added a reviewer: rsmith. sepavloff requested review of this revision. Herald added a project: clang. Class LValue keeps result of lvalue evaluation. In some analyses it is also necessary to have access to the original expression. This change adds new