https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123881

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> ---
   opr.add(*new Operator(boolOP,       "boolOP"));

This is not how you use C++. This looks like misunderstanding based on Java
idioms.

This should be simply opr.add(Operator(boolOP, "boolOP")) without using 'new'
and without leaking memory on every line.

  OpClass& opr = *new OpClass();// instantiation of container class

Again, this is not how you use C++. This should be:

  OpClass opr;

That's it, stop using 'new' to create objects that don't need to be on the
heap.

Since there is no testcase provided, but the code snippets are full of
problems, I'm going to assume this is INVALID. Please reopen if you can show
there's a real bug in GCC and not in your code.

Please follow the advice in the bug writing guidelines:

"if compiling with -fsanitize=address,undefined produces any run-time errors,
then your code is probably not correct."

"We also ask that for C++ code, users test their programs with
-D_GLIBCXX_ASSERTIONS."

Reply via email to