This works in MSVC2017 v15.6, but fails in MSVC2017 v15.7.2:
struct Foo { using T = int; };
template<class DERIVED, class WRAP>
struct A { using T = typename WRAP::T; };
template<class DERIVED>
struct B : public A<DERIVED, Foo> {
B(T t); //error C2061: syntax error: identifier 'T'
};
Desired: The using
declarations in the BASE
are exposed for use in the DERIVED
.
The fix for MSVC2017 v15.7.2 seems to be:
template<class DERIVED>
struct B : public A<DERIVED, Foo> {
using BASE = A<DERIVED, Foo>;
using T = typename BASE::T; // ??expose again??
B(T t); // OK (MSVC 2018 v15.7.2)
};
Is this a regression in MSVC2017 v15.7.2, or is this expected C++ behavior?
Note that this question is different from:
*- Type not found when derived from template base class
...because why is the public using
in the BASE
no longer visibile in the DERIVED
?