- Notifications
You must be signed in to change notification settings - Fork14.5k
Closed
Description
For some reason, I used a type alias when defining the move constructor, which compiles successfully on MSVC and GCC, but Clang doesn't allow it
I tested other special member functions, copy constructor, move constructor, copy assignment function can all use the= default
declaration explicitly in the case of using type alias, only move assignment function does not allow this, but it can use= delete
explicitly, so is this a bug?
here is my test code
// constant referencetemplate<typename T>using RC = Tconst &;// non-constant referencetemplate<typename T>using RV = T &;// r-value referencetemplate<typename T>using RM = T&&;structA {// default constructorA () =default;// copy constructorA (RC<A>) =default;// move constructorA (RM<A>) =default;// copy assignmentautooperator = (RC<A>) -> RV<A> =default;// move assignmentautooperator = (RM<A>) -> RV<A> =default;// error: only special member functions may be defaulted//auto operator = (RM<A>) -> RV<A> = delete; // OK};intmain () {return0;}