[clang] [Clang][Sema] Do not attempt to instantiate a deleted move constructor (PR #80959)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 7 06:17:12 PST 2024


================
@@ -7894,13 +7895,18 @@ bool Sema::CheckExplicitlyDefaultedSpecialMember(CXXMethodDecl *MD,
   if (ShouldDeleteForTypeMismatch || ShouldDeleteSpecialMember(MD, CSM)) {
     if (First) {
       SetDeclDeleted(MD, MD->getLocation());
-      if (!inTemplateInstantiation() && !HadError) {
-        Diag(MD->getLocation(), diag::warn_defaulted_method_deleted) << CSM;
+      if ((ForDefinition || !inTemplateInstantiation()) && !HadError) {
+        // Always error if we're about to generate a definition.
+        HadError = ForDefinition;
----------------
erichkeane wrote:

This does not seem right here... I would expect us to still want to instantiate the function, just skip doing that earlier.  I think the bisect as suggested by others to see if we can figure out what the difference is for the cause is a better way forward than this.

https://github.com/llvm/llvm-project/pull/80959


More information about the cfe-commits mailing list