This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/79668] New: [c++1z] inconsistent handling of parameter matching in template template arguments


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79668

            Bug ID: 79668
           Summary: [c++1z] inconsistent handling of parameter matching in
                    template template arguments
           Product: gcc
           Version: 7.0.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: richard-gccbugzilla at metafoo dot co.uk
  Target Milestone: ---

Consider the following:

template<template<short x> typename> struct A;
template<typename T, template<T x> typename> struct B;
template<int x> struct C;
A<C> *ac;
B<short, C> *bc;

It should hopefully be clear that the type 'A<C>' is valid if and only if the
type 'B<short, C>' is valid. However, under -std=c++1z, GCC accepts 'A<C>' but
rejects 'B<short, C>':


<source>:5:11: error: type/value mismatch at argument 2 in template parameter
list for 'template<class T, template<T x> class<template-parameter-1-2> >
struct B'
B<short, C> *bc;
^
<source>:5:11: note:   expected a template of type 'template<T x>
class<template-parameter-1-2>', got 'template<int x> struct C'
Compiler exited with result code 1


Note that the above error is also the one produced outside C++1z mode, so
perhaps whatever special handling is engaged for P0522R0 is missed in the case
where the template template parameter is dependent?

FWIW, Clang's implementation of P0522R0 accepts both cases.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]