Skip to content

[Clang][Sema] ASTContext::getUnconstrainedType propagates dependence #92425

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions clang/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,7 @@ Bug Fixes to C++ Support
- Clang now ignores template parameters only used within the exception specification of candidate function
templates during partial ordering when deducing template arguments from a function declaration or when
taking the address of a function template.
- Fix a bug with checking constrained non-type template parameters for equivalence. Fixes (#GH77377).

Bug Fixes to AST Handling
^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
3 changes: 2 additions & 1 deletion clang/lib/AST/ASTContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5910,7 +5910,8 @@ QualType ASTContext::getUnconstrainedType(QualType T) const {
if (auto *AT = CanonT->getAs<AutoType>()) {
if (!AT->isConstrained())
return T;
return getQualifiedType(getAutoType(QualType(), AT->getKeyword(), false,
return getQualifiedType(getAutoType(QualType(), AT->getKeyword(),
AT->isDependentType(),
AT->containsUnexpandedParameterPack()),
T.getQualifiers());
}
Expand Down
13 changes: 13 additions & 0 deletions clang/test/CXX/temp/temp.decls/temp.fct/temp.func.order/p2.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++20 %s
// expected-no-diagnostics

namespace GH77377 {
template<typename T>
concept C = sizeof(T) == sizeof(int);

template<auto N>
struct A;

template<C auto N>
struct A<N>;
}
Loading