diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp --- a/clang/lib/Sema/SemaDeclCXX.cpp +++ b/clang/lib/Sema/SemaDeclCXX.cpp @@ -14344,10 +14344,7 @@ /* Diagnose */ false); } - // Build an exception specification pointing back at this member. - FunctionProtoType::ExtProtoInfo EPI = - getImplicitMethodEPI(*this, MoveAssignment); - MoveAssignment->setType(Context.getFunctionType(RetType, ArgType, EPI)); + setupImplicitSpecialMemberType(MoveAssignment, RetType, ArgType); // Add the parameter to the operator. ParmVarDecl *FromParam = ParmVarDecl::Create(Context, MoveAssignment, diff --git a/clang/test/AST/ast-dump-implicit-members.clcpp b/clang/test/AST/ast-dump-implicit-members.clcpp new file mode 100644 --- /dev/null +++ b/clang/test/AST/ast-dump-implicit-members.clcpp @@ -0,0 +1,14 @@ +// RUN: %clang_cc1 %s -ast-dump -ast-dump-filter S | FileCheck -strict-whitespace %s + +struct S {}; + +void f() { + S i; + i = i; +} + +// CHECK: CXXConstructorDecl {{.*}} implicit used constexpr S 'void () __generic noexcept' +// CHECK: CXXConstructorDecl {{.*}} implicit constexpr S 'void (const __generic S &) __generic' +// CHECK: CXXConstructorDecl {{.*}} implicit constexpr S 'void (__generic S &&) __generic' +// CHECK: CXXMethodDecl {{.*}} implicit used constexpr operator= '__generic S &(const __generic S &) __generic noexcept' +// CHECK: CXXMethodDecl {{.*}} implicit constexpr operator= '__generic S &(__generic S &&) __generic'