[clang] [Clang][Sema] Fix crash when using name of UnresolvedUsingValueDecl with template arguments (PR #83842)

2024-03-11 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: So, it seems that this crash occurs because we filter out all non-template functions, which will trigger ADL if the only class member we found was a non-template function. https://github.com/llvm/llvm-project/pull/83842 ___

[clang] [Clang][Sema] Fix crash when using name of UnresolvedUsingValueDecl with template arguments (PR #83842)

2024-03-11 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @wlei-llvm Thank you! I've reduced the repro to this: ```cpp struct A { }; template void f(A); struct B { void f(); void g() { f(A()); } }; ``` https://github.com/llvm/llvm-project/pull/83842 ___ cfe-commits mailing list

[clang] [Clang][Sema] Fix crash when using name of UnresolvedUsingValueDecl with template arguments (PR #83842)

2024-03-09 Thread Lei Wang via cfe-commits
wlei-llvm wrote: ``` clang++ -std=gnu++20 test.cpp clang-18: /../llvm-project/llvm/include/llvm/Support/Casting.h:578: decltype(auto) llvm::cast(From *) [To = clang::CXXRecordDecl, From = clang::DeclContext]: Assertion `isa(Val) && "cast() argument of incompatible type!"' failed. PLEASE

[clang] [Clang][Sema] Fix crash when using name of UnresolvedUsingValueDecl with template arguments (PR #83842)

2024-03-09 Thread Lei Wang via cfe-commits
wlei-llvm wrote: Here is the repro from our side. It's reduced by creduce, there are some unrelated error, the assertion is the real issue. ``` typedef a; template < typename b, b c > struct d { static constexpr b e = c; }; typedef d< bool, true > f; typedef d< bool, false > g; template <

[clang] [Clang][Sema] Fix crash when using name of UnresolvedUsingValueDecl with template arguments (PR #83842)

2024-03-08 Thread via cfe-commits
bgra8 wrote: Thanks a lot @sdkrystian ! We have a reducer session running! We'll post here when we have it! https://github.com/llvm/llvm-project/pull/83842 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Clang][Sema] Fix crash when using name of UnresolvedUsingValueDecl with template arguments (PR #83842)

2024-03-08 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @bgra8 Reverted. Any sort of repro would be appreciated :) https://github.com/llvm/llvm-project/pull/83842 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Fix crash when using name of UnresolvedUsingValueDecl with template arguments (PR #83842)

2024-03-08 Thread via cfe-commits
bgra8 wrote: @sdkrystian we, at google, bisected lots (~1k) of clang crashes to this revision. Looks to me Facebook code is also impacted. We need some time to provide a repro. Until then can you please revert? https://github.com/llvm/llvm-project/pull/83842

[clang] [Clang][Sema] Fix crash when using name of UnresolvedUsingValueDecl with template arguments (PR #83842)

2024-03-07 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @wlei-llvm Not a known issue... could you provide a repro? I'll look into this in the meantime. https://github.com/llvm/llvm-project/pull/83842 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Clang][Sema] Fix crash when using name of UnresolvedUsingValueDecl with template arguments (PR #83842)

2024-03-07 Thread Lei Wang via cfe-commits
wlei-llvm wrote: Hi: We hit a crash/assertion, and bisected to this. Here is the stack dump: ``` clang++: /home/wlei/local/upstream/llvm-project/llvm/include/llvm/Support/Casting.h:578: decltype(auto) llvm::cast(From *) [To = clang::CXXRecordDecl, From = clang::DeclContext]: Assertion

[clang] [Clang][Sema] Fix crash when using name of UnresolvedUsingValueDecl with template arguments (PR #83842)

2024-03-05 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian closed https://github.com/llvm/llvm-project/pull/83842 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Fix crash when using name of UnresolvedUsingValueDecl with template arguments (PR #83842)

2024-03-05 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/83842 >From 4725321631e69c8d8480e0dba85128d177541a89 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Mon, 4 Mar 2024 08:10:35 -0500 Subject: [PATCH 1/5] [Clang][Sema] Fix crash when using name of

[clang] [Clang][Sema] Fix crash when using name of UnresolvedUsingValueDecl with template arguments (PR #83842)

2024-03-05 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/83842 >From 4725321631e69c8d8480e0dba85128d177541a89 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Mon, 4 Mar 2024 08:10:35 -0500 Subject: [PATCH 1/4] [Clang][Sema] Fix crash when using name of

[clang] [Clang][Sema] Fix crash when using name of UnresolvedUsingValueDecl with template arguments (PR #83842)

2024-03-05 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/83842 >From 4725321631e69c8d8480e0dba85128d177541a89 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Mon, 4 Mar 2024 08:10:35 -0500 Subject: [PATCH 1/3] [Clang][Sema] Fix crash when using name of

[clang] [Clang][Sema] Fix crash when using name of UnresolvedUsingValueDecl with template arguments (PR #83842)

2024-03-04 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/83842 >From aeeb445a9e52a8011a008a5ee3438709f835034c Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Mon, 4 Mar 2024 08:10:35 -0500 Subject: [PATCH 1/3] [Clang][Sema] Fix crash when using name of

[clang] [Clang][Sema] Fix crash when using name of UnresolvedUsingValueDecl with template arguments (PR #83842)

2024-03-04 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian edited https://github.com/llvm/llvm-project/pull/83842 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Fix crash when using name of UnresolvedUsingValueDecl with template arguments (PR #83842)

2024-03-04 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. This seems right to me, modulo the release note/updated commit message. https://github.com/llvm/llvm-project/pull/83842 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Clang][Sema] Fix crash when using name of UnresolvedUsingValueDecl with template arguments (PR #83842)

2024-03-04 Thread Erich Keane via cfe-commits
erichkeane wrote: > Updated with new fix (still need a release note) Please update the patch message in github (which should allow editing) to reflect the new approach. https://github.com/llvm/llvm-project/pull/83842 ___ cfe-commits mailing list

[clang] [Clang][Sema] Fix crash when using name of UnresolvedUsingValueDecl with template arguments (PR #83842)

2024-03-04 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/83842 >From aeeb445a9e52a8011a008a5ee3438709f835034c Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Mon, 4 Mar 2024 08:10:35 -0500 Subject: [PATCH 1/2] [Clang][Sema] Fix crash when using name of

[clang] [Clang][Sema] Fix crash when using name of UnresolvedUsingValueDecl with template arguments (PR #83842)

2024-03-04 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff c1d8d0aa156f651ee48414fa002e9608d6998763 de29206a4c1881acc4ed31fdd59ebed75f4388ca --

[clang] [Clang][Sema] Fix crash when using name of UnresolvedUsingValueDecl with template arguments (PR #83842)

2024-03-04 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: Updated with new fix https://github.com/llvm/llvm-project/pull/83842 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Fix crash when using name of UnresolvedUsingValueDecl with template arguments (PR #83842)

2024-03-04 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/83842 >From aeeb445a9e52a8011a008a5ee3438709f835034c Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Mon, 4 Mar 2024 08:10:35 -0500 Subject: [PATCH 1/2] [Clang][Sema] Fix crash when using name of

[clang] [Clang][Sema] Fix crash when using name of UnresolvedUsingValueDecl with template arguments (PR #83842)

2024-03-04 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/83842 >From aeeb445a9e52a8011a008a5ee3438709f835034c Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Mon, 4 Mar 2024 08:10:35 -0500 Subject: [PATCH 1/2] [Clang][Sema] Fix crash when using name of

[clang] [Clang][Sema] Fix crash when using name of UnresolvedUsingValueDecl with template arguments (PR #83842)

2024-03-04 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: Actually, I don't think the proposed fix here is quite right. If we _only_ find an `UnresolvedUsingValueDecl`, then we shouldn't assume the name is a template per [[temp.names] p3.3](http://eel.is/c++draft/temp.names#3.3)... will work on a new fix.

[clang] [Clang][Sema] Fix crash when using name of UnresolvedUsingValueDecl with template arguments (PR #83842)

2024-03-04 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian edited https://github.com/llvm/llvm-project/pull/83842 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Fix crash when using name of UnresolvedUsingValueDecl with template arguments (PR #83842)

2024-03-04 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Krystian Stasiowski (sdkrystian) Changes The following snippet causes a crash ([godbolt link](https://godbolt.org/z/E17sYfYrY)): ```cpp templatetypename T struct A : T { using T::f; void f(); void g() { fint(); // crash here

[clang] [Clang][Sema] Fix crash when using name of UnresolvedUsingValueDecl with template arguments (PR #83842)

2024-03-04 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian created https://github.com/llvm/llvm-project/pull/83842 The following snippet causes a crash ([godbolt link](https://godbolt.org/z/E17sYfYrY)): ```cpp template struct A : T { using T::f; void f(); void g() { f(); // crash here } }; ``` This happens