boostorg / boostorg/test

[patch] Clang 10 gives "marked as unused but used" warning on BOOST_AUTO_TEST_CASE

Open
#293 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
213
Forks
149
Avg merge
18h 17m
Merged PRs (30d)
2

Description

Compiling on FreeBSD 12.2 using Clang 10 and `-Wall -Wextra -Werror` gives this error when expanding `BOOST_AUTO_TEST_CASE` and other macros:

'unit_test_log' was marked unused but was used [-Werror,-Wused-but-marked-unused]

Attached is a patch which resolves the issue for me by removing the unused attribute from singleton references created by `BOOST_TEST_SINGLETON_INST` and instead having an inline function with an unused attribute that references the singleton.

[patch-boost_test_detail_global_typedef_hpp.txt](https://github.com/boostorg/test/files/5566345/patch-boost_test_detail_global_typedef_hpp.txt)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.