Index: clang/lib/Sema/SemaDeclCXX.cpp =================================================================== --- clang/lib/Sema/SemaDeclCXX.cpp +++ clang/lib/Sema/SemaDeclCXX.cpp @@ -14299,10 +14299,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, Index: clang/test/SemaOpenCLCXX/addrspace-assignment.clcpp =================================================================== --- /dev/null +++ clang/test/SemaOpenCLCXX/addrspace-assignment.clcpp @@ -0,0 +1,16 @@ +// RUN: %clang_cc1 %s -ast-dump -pedantic -verify | FileCheck %s + + +// CHECK: CXXConstructorDecl {{.*}} implicit {{.*}} Implicit 'void (const __generic Implicit &) __generic' +// CHECK: CXXConstructorDecl {{.*}} implicit {{.*}} Implicit 'void (__generic Implicit &&) __generic' +// CHECK: CXXMethodDecl {{.*}} implicit {{.*}} operator= '__generic Implicit &(const __generic Implicit &) __generic' +// CHECK: CXXMethodDecl {{.*}} implicit {{.*}} operator= '__generic Implicit &(__generic Implicit &&) __generic' +// expected-note@+2{{candidate function (the implicit copy assignment operator) not viable: no known conversion from 'int' to 'const __generic Implicit' for 1st argument}} +// expected-note@+1{{candidate function (the implicit move assignment operator) not viable: no known conversion from 'int' to '__generic Implicit' for 1st argument}} +struct Implicit {}; + +void f() { + Implicit i; + i = 10; // expected-error{{no viable overloaded '='}} +} +