[PATCH] D110641: Implement P0857R0 -Part B: requires clause for template-template params

Erich Keane via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 14 12:10:43 PDT 2022


erichkeane added a comment.

Comment based on @rsmith and EWG reflector feedback as to where this should be checked.



================
Comment at: clang/test/SemaTemplate/concepts.cpp:63
   template<typename T> concept C = true;
-  template<template<typename T> requires C<T> typename U> struct X {}; // expected-error {{requires 'class'}} expected-error 0+{{}}
+  template<template<typename T> requires C<T> typename U> struct X {};
   template<typename T> requires C<T> struct Y {};
----------------
Seemingly if "X" contains U<int>, the constraint should be checked (according to EWG).

Based on reflector conversations, it seems this should ALSO be checked in:

http://eel.is/c++draft/temp.arg.template#3
and 
http://eel.is/c++draft/temp.arg.template#4
, particularly the 'rewrite to function templates in /4 should produce a constrained function template, and the 'at least as specialized' check takes these into consideration.

They are ALSO considered in partial ordering.


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

https://reviews.llvm.org/D110641



More information about the cfe-commits mailing list