Patrick Williams | 8e7b46e | 2023-05-01 14:19:06 -0500 | [diff] [blame] | 1 | From 03bbb1b055c41ec652470f775b55a7cf80d664ef Mon Sep 17 00:00:00 2001 |
| 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Mon, 17 Apr 2023 16:46:12 -0700 |
| 4 | Subject: [PATCH] doctest: Do not use unnamed class |
| 5 | |
| 6 | When compiling with clang this results in emitting absolute path into |
| 7 | debug info, especially .debug_str section has |
| 8 | |
| 9 | ~(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) |
| 10 | (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) |
| 11 | |
| 12 | Therefore use a name for the class instead and help get rid of this |
| 13 | absolute path in debug info. This fixes |
| 14 | |
| 15 | File /usr/lib/libcereal/ptest/tests/.debug/test_unordered_map in package libcereal-dbg contains reference to TMPDIR |
| 16 | |
| 17 | Upstream-Status: Submitted [https://github.com/USCiLab/cereal/pull/788] |
| 18 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 19 | --- |
| 20 | unittests/doctest.h | 2 +- |
| 21 | 1 file changed, 1 insertion(+), 1 deletion(-) |
| 22 | |
| 23 | diff --git a/unittests/doctest.h b/unittests/doctest.h |
| 24 | index cd5b44d6..e6d8f7f9 100644 |
| 25 | --- a/unittests/doctest.h |
| 26 | +++ b/unittests/doctest.h |
| 27 | @@ -6424,7 +6424,7 @@ void Context::setCout(std::ostream* out) { p->cout = out; } |
| 28 | static class DiscardOStream : public std::ostream |
| 29 | { |
| 30 | private: |
| 31 | - class : public std::streambuf |
| 32 | + class discardBufStream: public std::streambuf |
| 33 | { |
| 34 | private: |
| 35 | // allowing some buffering decreases the amount of calls to overflow |
| 36 | -- |
| 37 | 2.40.0 |
| 38 | |