[clang] [clang] deprecate frelaxed-template-template-args, make it on by default (PR #89807)

Matheus Izvekov via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 24 21:10:51 PDT 2024


mizvekov wrote:

So Jason pointed out that GCC's provisional wording for CWG2398 picks a dubious candidate for this example:
```C++
template<typename T, typename U> struct match2;

template<template<typename A> class t1,typename T>
struct match2<t1<T>, typename t1<T>::type > { typedef int type; }; // #5                                                 

template<template<typename B, typename C> class t2,typename T0,typename T1>
struct match2<t2<T0,T1>, typename t2<T0,T0>::type > { typedef int type; }; // #6                                         

template <class T, class U = T> struct Q { typedef int type; };
match2<Q<int>, int> m;
```

They pick #6, where with this PR we stay with ambiguous.
According to [this GCC bug](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114841), he suggests changing GCC to adopt the wording proposed here.

https://github.com/llvm/llvm-project/pull/89807


More information about the cfe-commits mailing list