This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] warn on mem calls modifying objects of non-trivial types (PR 80560)


On 06/08/2017 01:25 PM, Martin Sebor wrote:
+      if (TREE_CHAIN (DECL_ARGUMENTS (f)))
+	{
+	  /* Skip constructors that aren't copy or move ctors.  */
+	  if (!copy_fn_p (f))
+	    continue;
+
+	  cpy_or_move_ctor_p = true;
+	}
+      else
+	{
+	  /* Constructor is a default ctor.  */
+	  cpy_or_move_ctor_p = false;
+	}

A default constructor can have parameters, so long as they have default arguments. You can use default_ctor_p to test for a default constructor.

Jason


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]