[PATCH] D147722: [Concepts] Fix Function Template Concepts comparisons

Erich Keane via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 6 12:55:23 PDT 2023


erichkeane added a comment.

The switching that to 'done' seems to have broken cases where the partial specialization itself has requires clauses on it, see https://github.com/llvm/llvm-project/blob/main/clang/test/CXX/temp/temp.constr/temp.constr.order/class-template-partial-specializations.cpp#L75

Static Assert on 75 and 76 now fail with:

   error: 'error' diagnostics seen but not expected:
    File /localdisk2/ekeane1/workspaces/llvm-project/clang/test/CXX/temp/temp.constr/temp.constr.order/class-template-partial-specializations.cpp Line 75: static assertion failed due to requirement 'S<1>::F<unsigned int>::value == 2'
    File /localdisk2/ekeane1/workspaces/llvm-project/clang/test/CXX/temp/temp.constr/temp.constr.order/class-template-partial-specializations.cpp Line 76: static assertion failed due to requirement 'S<1>::F<char[10]>::value == 3'
  error: 'note' diagnostics seen but not expected:
    File /localdisk2/ekeane1/workspaces/llvm-project/clang/test/CXX/temp/temp.constr/temp.constr.order/class-template-partial-specializations.cpp Line 75: expression evaluates to '1 == 2'
    File /localdisk2/ekeane1/workspaces/llvm-project/clang/test/CXX/temp/temp.constr/temp.constr.order/class-template-partial-specializations.cpp Line 76: expression evaluates to '1 == 3'
  4 errors generated.

AND https://github.com/llvm/llvm-project/blob/main/clang/test/SemaTemplate/concepts.cpp#L323

  error: 'error' diagnostics seen but not expected:
    File /localdisk2/ekeane1/workspaces/llvm-project/clang/test/SemaTemplate/concepts.cpp Line 332: no type named 'type' in 'DeducedTemplateArgs::ItrTraits<DeducedTemplateArgs::not_complete_itr>::Ptr<DeducedTemplateArgs::not_complete_itr>'
  error: 'note' diagnostics seen but not expected:
    File /localdisk2/ekeane1/workspaces/llvm-project/clang/test/SemaTemplate/concepts.cpp Line 341: in instantiation of template class 'DeducedTemplateArgs::ItrTraits<DeducedTemplateArgs::complete_itr>' requested here
  2 errors generated.

So I think it is causing something to not be in the right order there (particularly the 1st one).  I'll look into the identity replacement of template args.



================
Comment at: clang/lib/Sema/SemaTemplateInstantiate.cpp:291
 /// encountering a lambda generic call operator, and continue looking for
 /// arguments on an enclosing class template.
 
----------------
alexander-shaposhnikov wrote:
> /* not directly related to this patch, just one thought while we are here */ 
> it would be useful to add missing documentation (comments) for the last parameter
> (SkipForSpecialization)
> p.s. perhaps, expanding the comment (or even adding some examples) would be super helpful as well (for future readers)
I definitely agree.. I don't particularly understand what happened there, but I couldn't come up with an alternate fix/come up with a 'better' solution to the problem.  See original commit here: https://reviews.llvm.org/D134128



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

https://reviews.llvm.org/D147722



More information about the cfe-commits mailing list