[clang] [Clang][Sema] Don't assert on friend declarators with an empty name (PR #223213)
Anirudh Mathur via cfe-commits
cfe-commits at lists.llvm.org
Sat Sep 19 01:20:55 PDT 2026
================
@@ -0,0 +1,5 @@
+// RUN: %clang_cc1 -std=c++17 -fsyntax-only -verify %s
+
+template <template <typename> class C> struct S { // expected-note {{template is declared here}}
+ friend C(); //expected-error {{cannot specify deduction guide for template template parameter 'C'}}
----------------
anirudhmathur12 wrote:
I did wonder whether it should emit a different diagnostic, and even [asked for opinion on LLVM's discussion form](https://discourse.llvm.org/t/make-the-constructor-of-a-class-declared-in-template-template-a-friend/91803), but after getting no reply, I assumed it would be safe if I just fixed the assert firing.
If fixing diagnostic is really the way to go, then I would be happy to push that to this PR immediately. Would appreciate any guidance on it though, as I am not very familiar with the codebase.
https://github.com/llvm/llvm-project/pull/223213
More information about the cfe-commits
mailing list