mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-17 15:56:40 +00:00

Fixes a crash where the template argument depth computed in the semantic context for a friend FunctionDecl with a constrained parameter is compared against arguments in the lexical context for the purpose of checking if the constraint depends on enclosing template parameters. Since getTemplateInstantiationArgs in this case follows the semantic DC for friend FunctionDecls, the resulting depth is incorrect and trips an assertion. Fixes #75426
17 lines
322 B
C++
17 lines
322 B
C++
// RUN: %clang_cc1 -std=c++20 -fsyntax-only -verify %s
|
|
// expected-no-diagnostics
|
|
|
|
template<typename T> concept C = true;
|
|
|
|
struct A {
|
|
template<C T> void f();
|
|
};
|
|
|
|
auto L = []<C T>{};
|
|
|
|
template<typename X>
|
|
class Friends {
|
|
template<C T> friend void A::f();
|
|
template<C T> friend void decltype(L)::operator()();
|
|
};
|