@@ -1714,6 +1714,8 @@ class ConstraintRefersToContainingTemplateChecker
// Friend, likely because it was referred to without its template arguments.
void CheckIfContainingRecord(const CXXRecordDecl *CheckingRD) {
CheckingRD = CheckingRD->getMostRecentDecl();
+if (!C
@@ -0,0 +1,34 @@
+// RUN: %clang_cc1 -std=c++20 -verify %s
+
+template
+concept C = true;
+
+class non_temp {
+template T>
+friend void f();
+
+non_temp();
+};
+
+template T>
+void f() {
+auto v = non_temp();
+}
+
+template
+class temp {
+template T>
+frien
@@ -1714,6 +1714,8 @@ class ConstraintRefersToContainingTemplateChecker
// Friend, likely because it was referred to without its template arguments.
void CheckIfContainingRecord(const CXXRecordDecl *CheckingRD) {
CheckingRD = CheckingRD->getMostRecentDecl();
+if (!C
@@ -1714,6 +1714,8 @@ class ConstraintRefersToContainingTemplateChecker
// Friend, likely because it was referred to without its template arguments.
void CheckIfContainingRecord(const CXXRecordDecl *CheckingRD) {
CheckingRD = CheckingRD->getMostRecentDecl();
+if (!C
https://github.com/erichkeane approved this pull request.
https://github.com/llvm/llvm-project/pull/74265
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,34 @@
+// RUN: %clang_cc1 -std=c++20 -verify %s
+
+template
+concept C = true;
+
+class non_temp {
+template T>
+friend void f();
+
+non_temp();
+};
+
+template T>
+void f() {
+auto v = non_temp();
+}
+
+template
+class temp {
+template T>
+frien
https://github.com/antangelo created
https://github.com/llvm/llvm-project/pull/74265
When checking if the constraint uses any enclosing template parameters for
[temp.friend]p9, if a containing record is used as argument, we assume that the
constraint depends on enclosing template parameters wi
llvmbot wrote:
@llvm/pr-subscribers-clang
Author: None (antangelo)
Changes
When checking if the constraint uses any enclosing template parameters for
[temp.friend]p9, if a containing record is used as argument, we assume that the
constraint depends on enclosing template parameters withou
https://github.com/antangelo updated
https://github.com/llvm/llvm-project/pull/74265
>From a8e841657b9816a78f6eb1520c8513454fe0008b Mon Sep 17 00:00:00 2001
From: Antonio Abbatangelo
Date: Tue, 28 Nov 2023 21:19:13 -0500
Subject: [PATCH 1/2] [clang] Exclude non-template classes when checking if