[clang] [Clang][Sema] Fix malformed AST for anonymous class access in template. (PR #90842)

2024-05-14 Thread via cfe-commits
https://github.com/martinboehme closed https://github.com/llvm/llvm-project/pull/90842 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Fix malformed AST for anonymous class access in template. (PR #90842)

2024-05-14 Thread via cfe-commits
martinboehme wrote: CI failure (DataFlowSanitizer-x86_64 :: release_shadow_space.c) looks unrelated. Will merge now. @shafik If you have any remaining comments, happy to address those in a followup PR. https://github.com/llvm/llvm-project/pull/90842

[clang] [Clang][Sema] Fix malformed AST for anonymous class access in template. (PR #90842)

2024-05-13 Thread Richard Smith via cfe-commits
https://github.com/zygoloid approved this pull request. Nothing further on my side, LGTM https://github.com/llvm/llvm-project/pull/90842 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Clang][Sema] Fix malformed AST for anonymous class access in template. (PR #90842)

2024-05-13 Thread via cfe-commits
martinboehme wrote: @zygoloid @shafik Any additional comments here, or is this good to go? https://github.com/llvm/llvm-project/pull/90842 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Clang][Sema] Fix malformed AST for anonymous class access in template. (PR #90842)

2024-05-07 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. Seems simple enough, and the AST output looks reasonable. https://github.com/llvm/llvm-project/pull/90842 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Clang][Sema] Fix malformed AST for anonymous class access in template. (PR #90842)

2024-05-07 Thread via cfe-commits
martinboehme wrote: > Note there is a `BuildAnonymousStructUnionMemberReference`, I am not sure it > solves your problem. Thanks. The issue with this is that it requires an `IndirectFieldDecl` to call it, and that's hard to get at -- see also my response to @zygoloid.

[clang] [Clang][Sema] Fix malformed AST for anonymous class access in template. (PR #90842)

2024-05-07 Thread via cfe-commits
martinboehme wrote: > Another possibility to consider: when [transforming a member > access](https://github.com/llvm/llvm-project/blob/ff210b94d449de8ebe1f32cf0d7763ba63b27b39/clang/lib/Sema/TreeTransform.h#L11950), > strip off any implicit member accesses from the base expression before >

[clang] [Clang][Sema] Fix malformed AST for anonymous class access in template. (PR #90842)

2024-05-07 Thread via cfe-commits
martinboehme wrote: > > This is the option I've decided to go with here. There's a slight wrinkle > > in that we create a LookupResult that claims we looked up the unnamed field > > for the anonymous class -- even though we would obviously never be able to > > look up an unnamed field. I

[clang] [Clang][Sema] Fix malformed AST for anonymous class access in template. (PR #90842)

2024-05-07 Thread via cfe-commits
martinboehme wrote: > Thank you for this fix. > > You should reference the issue that this fixes in your summary. There isn't currently a github issue for this. Should I create one? > This also need a release note. Added. How does this look? (Is it in the appropriate section?)

[clang] [Clang][Sema] Fix malformed AST for anonymous class access in template. (PR #90842)

2024-05-07 Thread via cfe-commits
https://github.com/martinboehme updated https://github.com/llvm/llvm-project/pull/90842 >From 4cbb2ae74abba0cff20d2c9018680c7bcc743316 Mon Sep 17 00:00:00 2001 From: Martin Braenne Date: Thu, 2 May 2024 09:59:16 + Subject: [PATCH 1/3] [Clang][Sema] Fix malformed AST for anonymous class

[clang] [Clang][Sema] Fix malformed AST for anonymous class access in template. (PR #90842)

2024-05-02 Thread Richard Smith via cfe-commits
https://github.com/zygoloid commented: Another possibility to consider: when [transforming a member access](https://github.com/llvm/llvm-project/blob/ff210b94d449de8ebe1f32cf0d7763ba63b27b39/clang/lib/Sema/TreeTransform.h#L11950), strip off any implicit member accesses from the base expression

[clang] [Clang][Sema] Fix malformed AST for anonymous class access in template. (PR #90842)

2024-05-02 Thread Shafik Yaghmour via cfe-commits
shafik wrote: Note there is a `BuildAnonymousStructUnionMemberReference`, I am not sure it solves your problem. https://github.com/llvm/llvm-project/pull/90842 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Clang][Sema] Fix malformed AST for anonymous class access in template. (PR #90842)

2024-05-02 Thread Erich Keane via cfe-commits
erichkeane wrote: >This is the option I've decided to go with here. There's a slight wrinkle in >that we create a LookupResult that claims we looked up the unnamed field for >the anonymous class -- even though we would obviously never be able to look up >an unnamed field. I think this is

[clang] [Clang][Sema] Fix malformed AST for anonymous class access in template. (PR #90842)

2024-05-02 Thread Shafik Yaghmour via cfe-commits
@@ -2876,10 +2876,21 @@ class TreeTransform { return ExprError(); Base = BaseResult.get(); + // We want to use `BuildMemberReferenceExpr()` so we can use its logic + // that materializes `Base` into a temporary if it's a prvalue. + // To do so, we

[clang] [Clang][Sema] Fix malformed AST for anonymous class access in template. (PR #90842)

2024-05-02 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Thank you for this fix. You should reference the issue that this fixes in your summary. This also need a release note. https://github.com/llvm/llvm-project/pull/90842 ___ cfe-commits mailing list

[clang] [Clang][Sema] Fix malformed AST for anonymous class access in template. (PR #90842)

2024-05-02 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik edited https://github.com/llvm/llvm-project/pull/90842 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Fix malformed AST for anonymous class access in template. (PR #90842)

2024-05-02 Thread via cfe-commits
martinboehme wrote: @AaronBallman You're probably not the right person to review this yourself, but I'm told you probably have an idea of who might be an appropriate reviewer? https://github.com/llvm/llvm-project/pull/90842 ___ cfe-commits mailing

[clang] [Clang][Sema] Fix malformed AST for anonymous class access in template. (PR #90842)

2024-05-02 Thread via cfe-commits
https://github.com/martinboehme edited https://github.com/llvm/llvm-project/pull/90842 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Fix malformed AST for anonymous class access in template. (PR #90842)

2024-05-02 Thread via cfe-commits
https://github.com/martinboehme edited https://github.com/llvm/llvm-project/pull/90842 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Fix malformed AST for anonymous class access in template. (PR #90842)

2024-05-02 Thread via cfe-commits
https://github.com/martinboehme edited https://github.com/llvm/llvm-project/pull/90842 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Fix malformed AST for anonymous class access in template. (PR #90842)

2024-05-02 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: None (martinboehme) Changes # Observed erroneous behavior Prior to this change, a `MemberExpr` that accesses an anonymous class might have a prvalue as its base (even though C++ mandates that the base of a `MemberExpr` must be a glvalue),

[clang] [Clang][Sema] Fix malformed AST for anonymous class access in template. (PR #90842)

2024-05-02 Thread via cfe-commits
https://github.com/martinboehme created https://github.com/llvm/llvm-project/pull/90842 # Observed erroneous behavior Prior to this change, a `MemberExpr` that accesses an anonymous class might have a prvalue as its base (even though C++ mandates that the base of a `MemberExpr` must be a