FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

tests/TestTestRunner.cpp: avoid referencing yet unitialized member by trofi · Pull Request #185 · unittest-cpp/unittest-cpp · GitHub

tests/TestTestRunner.cpp: avoid referencing yet unitialized member - #185

Open
trofi wants to merge 1 commit into
unittest-cpp:masterfrom
trofi:master
Open

tests/TestTestRunner.cpp: avoid referencing yet unitialized member#185
trofi wants to merge 1 commit into
unittest-cpp:masterfrom
trofi:master

Conversation

trofi commented Nov 23, 2021

Copy link
Copy Markdown

On recent gcc-12 snapshot build fails as:

[ 52%] Building CXX object CMakeFiles/TestUnitTest++.dir/tests/TestTestRunner.cpp.o
unittest-cpp/tests/TestTestRunner.cpp:
  In constructor '{anonymous}::FixtureBase::FixtureBase()':
unittest-cpp/tests/TestTestRunner.cpp:48:19:
  error: member '{anonymous}::FixtureBase::reporter' is used uninitialized [-Werror=uninitialized]
   48 |          : runner(reporter)
      |                   ^~~~~~~~
cc1plus: all warnings being treated as errors

On https://gcc.gnu.org/PR103375 Andrew suggested to match order of class
members to avoid picking a member reference to yet unconstructed object.

On recent gcc-12 snapshot build fails as:

    [ 52%] Building CXX object CMakeFiles/TestUnitTest++.dir/tests/TestTestRunner.cpp.o
    unittest-cpp/tests/TestTestRunner.cpp:
      In constructor '{anonymous}::FixtureBase::FixtureBase()':
    unittest-cpp/tests/TestTestRunner.cpp:48:19:
      error: member '{anonymous}::FixtureBase::reporter' is used uninitialized [-Werror=uninitialized]
       48 |          : runner(reporter)
          |                   ^~~~~~~~
    cc1plus: all warnings being treated as errors

On https://gcc.gnu.org/PR103375 Andrew suggested to match order of class
members to avoid picking a member reference to yet unconstructed object.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant


Back | FazBrowse Home | New Git URL