[clang] [clang][Sema] Allow abstract declarators to specify cv-qualified function types as per CWG1417 (PR #209836)
Yanzuo Liu via cfe-commits
cfe-commits at lists.llvm.org
Thu Jul 16 09:08:57 PDT 2026
================
@@ -751,3 +751,13 @@ struct A {
static_assert(__is_trivial(A), "");
#endif
} // namespace cwg1496
+
+namespace cwg1417 { // cwg1417: 24
+ template<typename T> struct S {
+ typedef T F;
+ typedef T *P; // expected-error {{pointer to function type 'void () const' cannot have 'const' qualifier}}
+ // expected-note@#cwg1417-s {{in instantiation of template class 'cwg1417::S<void () const>' requested here}}
+ typedef T &R; // expected-error {{reference to function type 'void () const' cannot have 'const' qualifier}}
----------------
zwuis wrote:
> - Errors and warnings are placed on the next line after the line they are expecting a diagnostic at, and at the same indentation.
https://github.com/llvm/llvm-project/pull/209836
More information about the cfe-commits
mailing list