[clang] [clang] Exclude non-template classes when checking if constraint refers to containing template arguments (PR #74265)

2023-12-04 Thread Erich Keane via cfe-commits
@@ -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

[clang] [clang] Exclude non-template classes when checking if constraint refers to containing template arguments (PR #74265)

2023-12-04 Thread Erich Keane via 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

[clang] [clang] Exclude non-template classes when checking if constraint refers to containing template arguments (PR #74265)

2023-12-05 Thread via cfe-commits
@@ -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

[clang] [clang] Exclude non-template classes when checking if constraint refers to containing template arguments (PR #74265)

2023-12-05 Thread Erich Keane via cfe-commits
@@ -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

[clang] [clang] Exclude non-template classes when checking if constraint refers to containing template arguments (PR #74265)

2023-12-05 Thread Erich Keane via cfe-commits
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

[clang] [clang] Exclude non-template classes when checking if constraint refers to containing template arguments (PR #74265)

2023-12-05 Thread via 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

[clang] [clang] Exclude non-template classes when checking if constraint refers to containing template arguments (PR #74265)

2023-12-03 Thread via cfe-commits
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

[clang] [clang] Exclude non-template classes when checking if constraint refers to containing template arguments (PR #74265)

2023-12-03 Thread via cfe-commits
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

[clang] [clang] Exclude non-template classes when checking if constraint refers to containing template arguments (PR #74265)

2023-12-03 Thread via cfe-commits
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