[PATCH] D113749: [Clang] Fix nesting of discarded and immediate contexts.

2021-12-07 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D113749#3172722 , @hollinsky wrote: > This change breaks return value deduction of template instantiations that > first occur within a discarded context. Thank you for letting us know! I think we've fixed this issue in

[PATCH] D113749: [Clang] Fix nesting of discarded and immediate contexts.

2021-12-06 Thread Paul Hollinsky via Phabricator via cfe-commits
hollinsky added a comment. This change breaks return value deduction of template instantiations that first occur within a discarded context. template class Foo { public: constexpr Foo(const char str[S]) : buf(str[0]) {} char get() const { return buf; } char buf; }

[PATCH] D113749: [Clang] Fix nesting of discarded and immediate contexts.

2021-12-01 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman closed this revision. aaron.ballman added a comment. I've commit on your behalf in 6eeda06c1d22da2b9fe96a2569a8a0f8e4f36880 , thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://rev

[PATCH] D113749: [Clang] Fix nesting of discarded and immediate contexts.

2021-12-01 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. LGTM! Thank you for the fix! Comment at: clang/lib/Sema/SemaExpr.cpp:16575-16578 + ExprEvalContexts[ExprEvalContexts.size() - 2] + .isDiscardedSta

[PATCH] D113749: [Clang] Fix nesting of discarded and immediate contexts.

2021-12-01 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added inline comments. Comment at: clang/lib/Sema/SemaExpr.cpp:16575-16578 + ExprEvalContexts[ExprEvalContexts.size() - 2] + .isDiscardedStatementContext(); + ExprEvalContexts.back().InImmediateFunctionContext = + ExprEvalContexts[ExprEvalContexts.siz

[PATCH] D113749: [Clang] Fix nesting of discarded and immediate contexts.

2021-12-01 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin updated this revision to Diff 391032. cor3ntin added a comment. Remove bitfields Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113749/new/ https://reviews.llvm.org/D113749 Files: clang/include/clang/Sema/Sema.h clang/lib/Sema/SemaExpr

[PATCH] D113749: [Clang] Fix nesting of discarded and immediate contexts.

2021-12-01 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin updated this revision to Diff 391030. cor3ntin marked an inline comment as done. cor3ntin added a comment. Add and fix comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113749/new/ https://reviews.llvm.org/D113749 Files: clang/incl

[PATCH] D113749: [Clang] Fix nesting of discarded and immediate contexts.

2021-12-01 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/include/clang/Sema/Sema.h:1300-1301 +bool InDiscardedStatement : 1; +bool InImmediateFunctionContext : 1; + No real benefit to making these bit-fields, and it'd be good to add some documentation ab