Skip to content

Commit

Permalink
doctest: Do not use unnamed class
Browse files Browse the repository at this point in the history
When compiling with clang this results in emitting absolute path into
debug info, especially .debug_str section has

~(unnamed class at /mnt/b/yoe/master/build/tmp/work/core2-64-yoe-linux-musl/libcereal/1.3.2+gitAUTOINC+ebef1e9298-r0/git/unittests/doctest.h:6428:5)
(unnamed class at /mnt/b/yoe/master/build/tmp/work/core2-64-yoe-linux-musl/libcereal/1.3.2+gitAUTOINC+ebef1e9298-r0/git/unittests/doctest.h:6428:5)

Therefore use a name for the class instead and help get rid of this
absolute path in debug info. This fixes

File /usr/lib/libcereal/ptest/tests/.debug/test_unordered_map in package libcereal-dbg contains reference to TMPDIR

Signed-off-by: Khem Raj <raj.khem@gmail.com>
  • Loading branch information
kraj committed Apr 17, 2023
1 parent ddd4672 commit 2189c3a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion unittests/doctest.h
Original file line number Diff line number Diff line change
Expand Up @@ -6424,7 +6424,7 @@ void Context::setCout(std::ostream* out) { p->cout = out; }
static class DiscardOStream : public std::ostream
{
private:
class : public std::streambuf
class discardBufStream: public std::streambuf
{
private:
// allowing some buffering decreases the amount of calls to overflow
Expand Down

0 comments on commit 2189c3a

Please sign in to comment.