]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/cp/cvt.c
Wrap option names in gcc internal messages with %< and %>.
[thirdparty/gcc.git] / gcc / cp / cvt.c
index 9142811939809e6604ae66a49a8bf4342a7fe694..c10db92bd6f31ecf2aabf38025502bf62682fcbc 100644 (file)
@@ -1175,6 +1175,16 @@ convert_to_void (tree expr, impl_conv_void implicit, tsubst_flags_t complain)
       break;
 
     case CALL_EXPR:   /* We have a special meaning for volatile void fn().  */
+      /* cdtors may return this or void, depending on
+        targetm.cxx.cdtor_returns_this, but this shouldn't affect our
+        decisions here: neither nodiscard warnings (nodiscard cdtors
+        are nonsensical), nor should any constexpr or template
+        instantiations be affected by an ABI property that is, or at
+        least ought to be transparent to the language.  */
+      if (tree fn = cp_get_callee_fndecl_nofold (expr))
+       if (DECL_CONSTRUCTOR_P (fn) || DECL_DESTRUCTOR_P (fn))
+         return expr;
+
       maybe_warn_nodiscard (expr, implicit);
       break;
 
@@ -1913,7 +1923,7 @@ type_promotes_to (tree type)
          if (abi_version_crosses (6)
              && TYPE_MODE (prom) != TYPE_MODE (type))
            warning (OPT_Wabi, "scoped enum %qT passed through ... as "
-                    "%qT before -fabi-version=6, %qT after",
+                    "%qT before %<-fabi-version=6%>, %qT after",
                     type, prom, ENUM_UNDERLYING_TYPE (type));
          if (!abi_version_at_least (6))
            type = prom;