This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: New failing tests for g++



>>>>> "Robert" == Robert Lipe <robertl@dgii.com> writes:

[...]

    Robert> But neither of these tests compile for me.  I'd like to
    Robert> work that out before doing the commit.  They both fail on
    Robert> my Linux system (RH 5, probably 5.1 by the end of the
    Robert> week) with errors of the form:

In your mail I can't clearly see which name refers to which test.
Let me demonstrate the errors. This is a modified Slackware system,
with libc-5.4.44 and assorted headers, and egcs-version
/egcs/egcs/bin/g++ -v
Reading specs from /egcs/egcs/lib/gcc-lib/i686-pc-linux-gnulibc1/egcs-2.91.34/specs
gcc version egcs-2.91.34 19980608 (gcc2 ss-980502 experimental)

achibm5:~/difccd/tests >> cat catch_undef.C int main()
{
        try {
        }
        catch (bad_alloc) { // ERROR - parse error
                return 1;
        }
        return 0;
}

achibm5:~/difccd/tests >> /egcs/egcs/bin/g++ -ansi -pedantic-errors -c -Wall catch_undef.C 
catch_undef.C: In function `int main()':
catch_undef.C:5: Internal compiler error 109.
catch_undef.C:5: Please submit a full bug report to `egcs-bugs@cygnus.com'.

achibm5:~/difccd/tests >> cat opt.C 
// Build don't link
#include <list>
#include <functional>
#include <algorithm>
#include <cassert>
int main()
{
        list<int> l;
        l.push_back(1);
        l.push_back(2);

        list<int>::iterator it = 
                find_if( l.begin(), l.end(),
                         // This is a typo, it should be bind2nd, but an
                         // ICE is not a very helpful diagnostic!
                         binder2nd( equal_to<int>(), 2 ) ); 
        assert( *(it) == 2 );
}

achibm5:~/difccd/tests >> /egcs/egcs/bin/g++ -ansi -pedantic-errors -c -Wall opt.C 
opt.C: In function `int main()':
opt.C:16: Internal compiler error.
opt.C:16: Please submit a full bug report to `egcs-bugs@cygnus.com'.

achibm5:~/difccd/tests >> cat hash_warn.C 
// Build don't link

#include <hash_set>

std::hash_set<int> foo;

achibm5:~/difccd/tests >> /egcs/egcs/bin/g++ -ansi -pedantic-errors -c -Wall hash_warn.C 
/egcs/egcs/include/g++/stl_hashtable.h: In method `hashtable<int,int,hash<int>,identity<int>,equal_to<int>,__default_alloc_template<false,0> >::hashtable<int, int, hash<int>, identity<int>, equal_to<int>, alloc>(unsigned int, const struct hash<int> &, const struct equal_to<int> &)':
/egcs/egcs/include/g++/stl_hash_set.h:74:   instantiated from `hash_set<int,hash<int>,equal_to<int>,__default_alloc_template<false,0> >::hash_set<int, hash<int>, equal_to<int>, alloc>()'
hash_warn.C:5:   instantiated from here
/egcs/egcs/include/g++/stl_hashtable.h:220: warning: statement with no effect


Now I tried it on a brand-new RH-5.0 system with egcs-version
achpc23:~/difccd/tests >> /usr/local/egcs/bin/g++ -v                           
Reading specs from /usr/local/egcs/lib/gcc-lib/i686-pc-linux-gnu/egcs-2.91.34/specs
gcc version egcs-2.91.34 19980608 (gcc2 ss-980502 experimental)

I get the same error as you, namely a parse error in 
/usr/include/pthread.h:436: parse error before `*'

After poking through the libc6-headers and the preprocessed source, I
found out that you have to define _POSIX_SOURCE in order to pull in the
missing definitions. 
After defining that, the result is the same on RH.

-- kga
-------------------------------------------------------------------------
Klaus-Georg Adams        Email: Klaus-Georg.Adams@chemie.uni-karlsruhe.de
Institut f. Anorg. Chemie, Lehrstuhl II            Tel: 49(0)721 608 3485
Universität Karlsruhe, D-76128 Karlsruhe
-------------------------------------------------------------------------


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]