-
Notifications
You must be signed in to change notification settings - Fork 15.5k
Closed
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"
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 reference
template <typename T>
using RC = T const &;
// non-constant reference
template <typename T>
using RV = T &;
// r-value reference
template <typename T>
using RM = T&&;
struct A {
// default constructor
A () = default;
// copy constructor
A (RC<A>) = default;
// move constructor
A (RM<A>) = default;
// copy assignment
auto operator = (RC<A>) -> RV<A> = default;
// move assignment
auto operator = (RM<A>) -> RV<A> = default; // error: only special member functions may be defaulted
//auto operator = (RM<A>) -> RV<A> = delete; // OK
};
int main () {
return 0;
}Metadata
Metadata
Assignees
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"