[clang] [clang] visit constraint of NTTP (PR #91842)

2024-05-16 Thread Qizhi Hu via cfe-commits
jcsxky wrote: > I don't think this is the right approach. I stepped though the example and > the reason we reject is because: > > * We substitute a dependent `AutoType` in for the types of the template > parameters when they are initially built. > * We call `getMoreSpecialized` determine

[clang] [clang] visit constraint of NTTP (PR #91842)

2024-05-16 Thread Younan Zhang via cfe-commits
zyn0217 wrote: > So, I think the correct fix is to propagate dependence in > ASTContext::getUnconstrainedType. I have a branch that implements this here. > WDYT @erichkeane @cor3ntin @zyn0217 That looks similar to the approach which I investigated some time ago. The difference is that I

[clang] [clang] visit constraint of NTTP (PR #91842)

2024-05-16 Thread Erich Keane via cfe-commits
https://github.com/erichkeane closed https://github.com/llvm/llvm-project/pull/91842 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] visit constraint of NTTP (PR #91842)

2024-05-16 Thread Erich Keane via cfe-commits
erichkeane wrote: > > Yeah, that seems incredibly reasonable and a much lower touch here with > > fewer concerns about the side-effects that we got here. > > Should I open a PR then? Yep, I think you should. Sorry @jcsxky : We're going to close this one, it seems that @sdkrystian has a

[clang] [clang] visit constraint of NTTP (PR #91842)

2024-05-16 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: > Yeah, that seems incredibly reasonable and a much lower touch here with fewer > concerns about the side-effects that we got here. Should I open a PR then? https://github.com/llvm/llvm-project/pull/91842 ___ cfe-commits mailing

[clang] [clang] visit constraint of NTTP (PR #91842)

2024-05-16 Thread Erich Keane via cfe-commits
erichkeane wrote: > I don't think this is the right approach. I stepped though the example and > the reason we reject is because: > > * We substitute a dependent `AutoType` in for the types of the template > parameters when they are initially built. > > * We call `getMoreSpecialized`

[clang] [clang] visit constraint of NTTP (PR #91842)

2024-05-16 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: I don't think this is the right approach. I stepped though the example and the reason we reject is because: - We substitute a dependent `AutoType` in for the types of the template parameters when they are initially built. - We call `getMoreSpecialized` determine whether the

[clang] [clang] visit constraint of NTTP (PR #91842)

2024-05-12 Thread Qizhi Hu via cfe-commits
https://github.com/jcsxky updated https://github.com/llvm/llvm-project/pull/91842 >From 0ebdcec675c39b26b8bee1a8b07c12fae2c58523 Mon Sep 17 00:00:00 2001 From: huqizhi Date: Sat, 11 May 2024 14:04:23 +0800 Subject: [PATCH] [clang] visit constraint of NTTP --- clang/docs/ReleaseNotes.rst

[clang] [clang] visit constraint of NTTP (PR #91842)

2024-05-12 Thread Qizhi Hu via cfe-commits
https://github.com/jcsxky updated https://github.com/llvm/llvm-project/pull/91842 >From 4133001711b82c93e057e1bd05476c5d052d597f Mon Sep 17 00:00:00 2001 From: huqizhi Date: Sat, 11 May 2024 14:04:23 +0800 Subject: [PATCH] [clang] visit constraint of NTTP --- clang/docs/ReleaseNotes.rst

[clang] [clang] visit constraint of NTTP (PR #91842)

2024-05-11 Thread Qizhi Hu via cfe-commits
@@ -79,14 +79,14 @@ template struct Y2 {}; // expected-note {{partial template class U, typename... Z> struct Y3 { Y3()=delete; }; template class U, typename... Z> -struct Y3 { Y3()=delete; }; +struct Y3 { Y3()=delete; }; // expected-note {{partial specialization matches

[clang] [clang] visit constraint of NTTP (PR #91842)

2024-05-11 Thread Qizhi Hu via cfe-commits
https://github.com/jcsxky edited https://github.com/llvm/llvm-project/pull/91842 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] visit constraint of NTTP (PR #91842)

2024-05-11 Thread Qizhi Hu via cfe-commits
@@ -79,14 +79,14 @@ template struct Y2 {}; // expected-note {{partial template class U, typename... Z> struct Y3 { Y3()=delete; }; template class U, typename... Z> -struct Y3 { Y3()=delete; }; +struct Y3 { Y3()=delete; }; // expected-note {{partial specialization matches

[clang] [clang] visit constraint of NTTP (PR #91842)

2024-05-11 Thread Younan Zhang via cfe-commits
@@ -79,14 +79,14 @@ template struct Y2 {}; // expected-note {{partial template class U, typename... Z> struct Y3 { Y3()=delete; }; template class U, typename... Z> -struct Y3 { Y3()=delete; }; +struct Y3 { Y3()=delete; }; // expected-note {{partial specialization matches

[clang] [clang] visit constraint of NTTP (PR #91842)

2024-05-11 Thread via cfe-commits
@@ -79,14 +79,14 @@ template struct Y2 {}; // expected-note {{partial template class U, typename... Z> struct Y3 { Y3()=delete; }; template class U, typename... Z> -struct Y3 { Y3()=delete; }; +struct Y3 { Y3()=delete; }; // expected-note {{partial specialization matches

[clang] [clang] visit constraint of NTTP (PR #91842)

2024-05-11 Thread via cfe-commits
@@ -79,14 +79,14 @@ template struct Y2 {}; // expected-note {{partial template class U, typename... Z> struct Y3 { Y3()=delete; }; template class U, typename... Z> -struct Y3 { Y3()=delete; }; +struct Y3 { Y3()=delete; }; // expected-note {{partial specialization matches

[clang] [clang] visit constraint of NTTP (PR #91842)

2024-05-11 Thread Younan Zhang via cfe-commits
@@ -2257,6 +2257,11 @@ void StmtProfiler::VisitSubstNonTypeTemplateParmExpr( const SubstNonTypeTemplateParmExpr *E) { // Profile exactly as the replacement expression. Visit(E->getReplacement()); + if (auto *NTTP = + dyn_cast_if_present(E->getParameter());

[clang] [clang] visit constraint of NTTP (PR #91842)

2024-05-11 Thread Younan Zhang via cfe-commits
@@ -79,14 +79,14 @@ template struct Y2 {}; // expected-note {{partial template class U, typename... Z> struct Y3 { Y3()=delete; }; template class U, typename... Z> -struct Y3 { Y3()=delete; }; +struct Y3 { Y3()=delete; }; // expected-note {{partial specialization matches

[clang] [clang] visit constraint of NTTP (PR #91842)

2024-05-11 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-modules Author: Qizhi Hu (jcsxky) Changes attempt to fix https://github.com/llvm/llvm-project/issues/77377 `isSameTemplateArg` returns incorrect result since clang didn't visit constraint of NTTP. Furthermore, It makes class template partial

[clang] [clang] visit constraint of NTTP (PR #91842)

2024-05-11 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Qizhi Hu (jcsxky) Changes attempt to fix https://github.com/llvm/llvm-project/issues/77377 `isSameTemplateArg` returns incorrect result since clang didn't visit constraint of NTTP. Furthermore, It makes class template partial

[clang] [clang] visit constraint of NTTP (PR #91842)

2024-05-11 Thread Qizhi Hu via cfe-commits
https://github.com/jcsxky edited https://github.com/llvm/llvm-project/pull/91842 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] visit constraint of NTTP (PR #91842)

2024-05-11 Thread Qizhi Hu via cfe-commits
https://github.com/jcsxky created https://github.com/llvm/llvm-project/pull/91842 attempt to fix `isSameTemplateArg` returns incorrect result since clang didn't visit constraint of NTTP. Furthermore, It makes class template partial specialization not more specialized than the class template