[PATCH] D152242: [Clang] Allow omitting `typename` in befriended constructors parameters

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 6 05:41:39 PDT 2023


aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.

LGTM!



================
Comment at: clang/test/CXX/temp/temp.res/p4.cpp:182-183
+  friend X::X(T::type);
+  friend X::X(T::type = (int)(void(*)(typename T::type))(nullptr)); // expected-error {{friend declaration specifying a default argument must be a definition}}
+  friend X::X(T::type = (int)(void(*)(T::type))(nullptr)); // expected-error {{friend declaration specifying a default argument must be a definition}} \
+                                                           // expected-error {{expected expression}}
----------------
cor3ntin wrote:
> aaron.ballman wrote:
> > Hmmm, I was expecting a `missing 'typename'` test case, so perhaps add a friend declaration that's a definition instead?
> that is not possible for a constructor afaik
Oh shoot, that's a good point. Nevermiiiiiiind. :-)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D152242/new/

https://reviews.llvm.org/D152242



More information about the cfe-commits mailing list