Skip to content

compatible does not cover template template parameters after CWG3080 #9054

@abhinavagarwal07

Description

@abhinavagarwal07

[temp.arg.template]/1 now lets a template template parameter be used as a template template argument, but the compatibility bullets in /3 were never updated to match - they still only cover an argument denoting a class/alias template, variable template, or concept.

So this ordinary forwarding case has no wording making it well-formed:

template<template<class> class TT>
struct S { };

template<template<class> class UU>
void f() {
    S<UU> s;
}

UU is permitted by /1, but /3 never makes it compatible with TT, so the /4 non-pack match cannot succeed. GCC, Clang, MSVC, and EDG all accept it, so this looks like a missed follow-up to CWG3080 / P2841R7 - the fix is just to add the template-template-parameter alternatives to the three bullets in /3, mirroring /1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions