approvals / ApprovalTests.cpp

Native ApprovalTests for C++ on Linux, Mac and Windows
https://approvaltestscpp.readthedocs.io/en/latest/
Apache License 2.0
316 stars 51 forks source link

Enable code to compile with -Wshadow enabled #111

Closed claremacrae closed 4 years ago

claremacrae commented 4 years ago

In pairing with a user today, we found that some code in this library did not compile on Mac with -Wshadow-field-in-constructor enabled, as we have some constructor arguments whose names match the names of data members.

See this for why this matters:

https://stackoverflow.com/questions/34895661/why-does-the-compiler-warn-about-shadowing-a-member-in-initalization-lists

claremacrae commented 4 years ago

Version: v.8.4.0

claremacrae commented 4 years ago

This is now fixed, by adding -Wshadow to clang and gcc builds, and fixing all the compilation failures in Travis, AppVeyor and GitHub builds.