This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Namespace related g++ test failures with --enable-libstdcxx-v3
- To: gcc at gcc dot gnu dot org
- Subject: Namespace related g++ test failures with --enable-libstdcxx-v3
- From: Loren James Rittle <rittle at latour dot rsch dot comm dot mot dot com>
- Date: Fri, 5 May 2000 00:04:59 -0500 (CDT)
- Reply-to: rittle at rsch dot comm dot mot dot com
With a dejagnu patch to libgloss.exp to teach it how to locate
libstdc++-v3 libraries and headers in the source and build tree (See
http://sourceware.cygnus.com/ml/libstdc++/2000-q2/msg00245.html), I am
currently getting about 120 failures in g++ tests when I configure and
bootstrap with --enable-libstdcxx-v3. I have analyzed that most/all
of these new failures under this configuration are due do namespace
issues. In particular, correct namespace std usage is now enforced
when the compiler is built that way (i.e. -fhonor-std is on by
default) but the failing tests don't qualify all library names
properly. Another point to consider: currently, libstdc++-v3 is not
providing .h-style compatibility headers unless you explicitly add
-I$prefix/include/g++-v3/backward to the compiler's command line. [I
think it is just a current Makefile bug but the iostream.h and new.h
compatibility headers aren't being installed at the moment.]
First, assuming a newly failing test currently looks like this:
#include <iostream.h>
int main() {
cout<<"hi"<<endl;
return 0;
}
Would people prefer a patch that fixes the problem as:
(A) Ensure that only g++ tests that are currently failing due to
namespace issues are run with -I$src/libstdc++-v3/backward only
when configured with --enable-libstdcxx-v3.
Note: I don't know how to do this.
(B) Ensure that all g++ tests are run with -I$src/libstdc++-v3/backward
only when configured with --enable-libstdcxx-v3.
Note: I know how to do this. In fact, I have done this and
started to extend the compatibility headers a bit based upon tests
which continued to fail. ;-) I am down to 70 failures with another
20 or so obviously addressable by adding new compatibility headers
to libstdc++-v3.
(C)
#include <iostream>
int main() {
std::cout<<"hi"<<std::endl;
return 0;
}
(D)
#include <iostream>
using namespace std;
int main() {
cout<<"hi"<<endl;
return 0;
}
(E) Patch some like C and some like D (and some like A, if possible)
just to mix it up a bit.
Second, assuming a newly failing test currently looks like this:
#include <iostream>
int main() {
cout<<"hi"<<endl;
return 0;
}
Should it be fixed as C or D above? Or, do you want it converted to
use the compatibility header?
I think using approach B is fine in the first case and, although it
takes a bit more work, approach C is best for the second case.
Comments?
Regards,
Loren