[clang][NFC] Add a test showcasing an unnamed template parameter in a diagnostic
authorBruno Ricci <riccibrun@gmail.com>
Wed, 5 Aug 2020 10:41:51 +0000 (11:41 +0100)
committerBruno Ricci <riccibrun@gmail.com>
Wed, 5 Aug 2020 12:54:36 +0000 (13:54 +0100)
clang/test/SemaCXX/cxx1z-class-template-argument-deduction.cpp

index 2a3f312..e992c7c 100644 (file)
@@ -172,6 +172,10 @@ namespace nondeducible {
   template<typename A = int,
            typename ...B>
   X(float) -> X<A, B...>; // ok
+
+  template <typename> struct UnnamedTemplateParam {};
+  template <typename>                                  // expected-note {{non-deducible template parameter (anonymous)}}
+  UnnamedTemplateParam() -> UnnamedTemplateParam<int>; // expected-error {{deduction guide template contains a template parameter that cannot be deduced}}
 }
 
 namespace default_args_from_ctor {