[PATCH] D103252: [C++4OpenCL] Fix missing address space on implicit move assignment operator

Ole Strohm via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 1 07:21:58 PDT 2021


olestrohm updated this revision to Diff 348969.
olestrohm added a comment.

Cleaned up the test by renaming the struct and making the test compile.

The test has also been moved to `clang/test/AST` as suggested, since it really
just makes sure that the generated AST contains the correct implicit methods.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D103252/new/

https://reviews.llvm.org/D103252

Files:
  clang/lib/Sema/SemaDeclCXX.cpp
  clang/test/AST/ast-dump-implicit-members.clcpp


Index: clang/test/AST/ast-dump-implicit-members.clcpp
===================================================================
--- /dev/null
+++ 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'
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,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D103252.348969.patch
Type: text/x-patch
Size: 1552 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210601/ac78bafe/attachment.bin>


More information about the cfe-commits mailing list