Menu

#129 test fails with gcc 3.4.1

open
nobody
5
2004-09-03
2004-09-03
Anonymous
No

test CheesTest does not compile with gcc 3.4.1.
Ther should be fixed: testNumberOfPieces method:
m_game into this->m_game

Bogdan

Discussion

  • Nobody/Anonymous

    Logged In: NO

    It's been one year ago, and nobody DID answer that?

    What a shame to this team

     
  • Anthony Ricke

    Anthony Ricke - 2007-11-13

    Logged In: YES
    user_id=1936416
    Originator: NO

    I received the same error when compiling version 1.10.2 in Cygwin with version 3.4.4 of GCC. The specific error I received is as follows:

    $ make check
    make hierarchy.exe
    make[1]: Entering directory `cppunit-1.10.2/examples/hier
    archy'
    if g++ -DHAVE_CONFIG_H -I. -I. -I../../config -I../../include -I../../include -g -O2 -MT main.o -
    MD -MP -MF ".deps/main.Tpo" \ -c -o main.o `test -f 'main.cpp' || echo './'`main.cpp; \ then mv -f ".deps/main.Tpo" ".deps/main.Po"; \ else rm -f ".deps/main.Tpo"; exit 1; \ fi
    In file included from main.cpp:6:
    ChessTest.h: In member function `void ChessTest<GAMECLASS>::testNumberOfPieces()':
    ChessTest.h:19: error: `m_game' undeclared (first use this function)
    ChessTest.h:19: error: (Each undeclared identifier is reported only once for each function it appear
    s in.)
    ChessTest.h:19: error: no matching function for call to `CppUnit::Asserter::failIf(<type error>, Cpp
    Unit::Message&, CppUnit::SourceLine&)'
    ../../include/cppunit/Asserter.h:66: note: candidates are: static void CppUnit::Asserter::failIf(boo
    l, const CppUnit::Message&, const CppUnit::SourceLine&)
    ../../include/cppunit/Asserter.h:77: note: static void CppUnit::Asserter::failIf(bool, std::string,
    const CppUnit::SourceLine&)
    make[1]: *** [main.o] Error 1
    make[1]: Leaving directory `cppunit-1.10.2/examples/hierarchy'
    make: *** [check-am] Error 2

    This is actually a bug with GCC, not CppUnit. The compiler should recognize that m_game is a member of the base template class without the "this->". According to other entries, this patch was applied to 1.10.0. This tracker should be closed.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.