Hello,
I have an issue in the following case:
template<typename T>
class Proxy : public std::unique_ptr<T>
{
public:
// Note: both cases are compiling
#if 1
// Wrong, suggestion (see below) -> compilation error after applying fix
using BaseClass = std::unique_ptr<T>; // typedef
using BaseClass::unique_ptr; // using unique_ptr constructor
#else
// OK, no suggestion
using std::unique_ptr<T>::unique_ptr; // using unique_ptr constructor
#endif
};
class MyClass
{
public:
MyClass();
private:
class MyClassImpl;
Proxy<MyClassImpl> m_Impl;
};
class MyClass::MyClassImpl { };
MyClass::MyClass()
: m_Impl(new MyClassImpl())
{} // Suggestion here (when #if 1): "Default constructor body can be replaced with '= default'
// This suggestion shouldn't happen at all in any cases
/*
// Replaced by:
MyClass::MyClass()
: m_Impl(new MyClassImpl())
= default; // Compilation error: expecting {}
*/