MagentaTreehouse wrote: > The more I think about it, the more I think that we should modify the warning > to only happen on EXPLICIT qualifiers. So: > > ``` > struct Base{}; > using CBase = const Base; > > struct D1 : const Base {}; // DOES warn > struct D2 : CBase{}; // a DIFFERENT warning (same wording perhaps?) under a > different group. > template<typename T> Templ: const T{}; > Templ<Base> t; // Causes same warning as D1. > template<typename T> Templ2 : T{}; > Templ2<CBase> t; // Causes same warning as D2. > ```
Adding qualifiers directly in base specifiers is invalid (and all major compilers correctly reject this). See grammar in [[class.derived.general]/1](https://timsong-cpp.github.io/cppwp/n4950/class.derived#general-1). Qualifiers can indirectly come from `decltype`, template parameters, type aliases and so on. https://github.com/llvm/llvm-project/pull/132116 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits