Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

error when define a move assignment = default (if using type alias) #56456

Closed
Assignees
shafik
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"
@twinstar6980

Description

@twinstar6980

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;}

Metadata

Metadata

Assignees

Labels

clang:frontendLanguage frontend issues, e.g. anything involving "Sema"

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp