doctest icon indicating copy to clipboard operation
doctest copied to clipboard

v2.4.9 do not support CHECK_EQ for 2 ptr

Open hurricane1026 opened this issue 2 years ago • 2 comments

Description

in some cases, I need to compare 2 ptrs have same memory address or not. In doctest v2.4.7, just use CHECK_EQ(ptr1, &(obj2); it just works well. but in v2.4.9, it cannot be compiled with messsage "

error: cannot initialize a parameter of type 'const void *' with an lvalue of type 'void *(*)(unsigned long)'
            filldata<const void*>::fill(stream, in);
                                                ^~

and I need change the Assertion statement to CHECK_EQ(ptr1 == &obj2, true);

Steps to reproduce

use v2.4.8 with assertion of CHECK_EQ 2 ptrs.

Extra information

the new macro DOCTEST_STRINGIFY maybe t the rootcause.

  • doctest version: v2.4.9
  • Operating System: Fedora LInux 36 with 5.18.17-200 kernel
  • Compiler+version: **clang++ 14.0.0-1.fc36 will c++20 flag **

hurricane1026 avatar Aug 17 '22 09:08 hurricane1026

Related to or duplicate of? https://github.com/doctest/doctest/issues/665

nickdademo avatar Aug 22 '22 05:08 nickdademo

Related to or duplicate of? #665

I think so.

hurricane1026 avatar Aug 23 '22 03:08 hurricane1026

Fixed in dev!

Saalvage avatar Oct 04 '22 00:10 Saalvage

@Saalvage would that make sense to do a 2.4.10 release, so that we can have that patch included?

serge-sans-paille avatar Dec 03 '22 18:12 serge-sans-paille

@Saalvage would that make sense to do a 2.4.10 release, so that we can have that patch included?

i'd really appreciate this -- multiple distros have pulled n 2.4.9, and notcurses (and other) builds are broken everywhere that's been done.

dankamongmen avatar Dec 03 '22 19:12 dankamongmen