NEWS revision 50397
150397Sobrien*** Changes in EGCS 1.1: 250397Sobrien 350397Sobrien* Namespaces are fully supported. The library has not yet been converted 450397Sobrien to use namespace std, however, and the old std-faking code is still on by 550397Sobrien default. To turn it off, you can use -fhonor-std. 650397Sobrien 750397Sobrien* Massive template improvements: 850397Sobrien + member template classes are supported. 950397Sobrien + template friends are supported. 1050397Sobrien + template template parameters are supported. 1150397Sobrien + local classes in templates are supported. 1250397Sobrien + lots of bugs fixed. 1350397Sobrien 1450397Sobrien* operator new now throws bad_alloc where appropriate. 1550397Sobrien 1650397Sobrien* Exception handling is now thread safe, and supports nested exceptions and 1750397Sobrien placement delete. Exception handling overhead on x86 is much lower with 1850397Sobrien GNU as 2.9. 1950397Sobrien 2050397Sobrien* protected virtual inheritance is now supported. 2150397Sobrien 2250397Sobrien* Loops are optimized better; we now move the test to the end in most 2350397Sobrien cases, like the C frontend does. 2450397Sobrien 2550397Sobrien* For class D derived from B which has a member 'int i', &D::i is now of 2650397Sobrien type 'int B::*' instead of 'int D::*'. 2750397Sobrien 2850397Sobrien* An _experimental_ new ABI for g++ can be turned on with -fnew-abi. The 2950397Sobrien current features of this are more efficient allocation of base classes 3050397Sobrien (including the empty base optimization), and more compact mangling of C++ 3150397Sobrien symbol names (which can be turned on separately with -fsquangle). This 3250397Sobrien ABI is subject to change without notice, so don't use it for anything 3350397Sobrien that you don't want to rebuild with every release of the compiler. 3450397Sobrien 3550397Sobrien As with all ABI-changing flags, this flag is for experts only, as all 3650397Sobrien code (including the library code in libgcc and libstdc++) must be 3750397Sobrien compiled with the same ABI. 3850397Sobrien 3950397Sobrien*** Changes in EGCS 1.0: 4050397Sobrien 4150397Sobrien* A public review copy of the December 1996 Draft of the ISO/ANSI C++ 4250397Sobrien standard is now available. See 4350397Sobrien 4450397Sobrien http://www.cygnus.com/misc/wp/ 4550397Sobrien 4650397Sobrien for more information. 4750397Sobrien 4850397Sobrien* g++ now uses a new implementation of templates. The basic idea is that 4950397Sobrien now templates are minimally parsed when seen and then expanded later. 5050397Sobrien This allows conformant early name binding and instantiation controls, 5150397Sobrien since instantiations no longer have to go through the parser. 5250397Sobrien 5350397Sobrien What you get: 5450397Sobrien 5550397Sobrien + Inlining of template functions works without any extra effort or 5650397Sobrien modifications. 5750397Sobrien + Instantiations of class templates and methods defined in the class 5850397Sobrien body are deferred until they are actually needed (unless 5950397Sobrien -fexternal-templates is specified). 6050397Sobrien + Nested types in class templates work. 6150397Sobrien + Static data member templates work. 6250397Sobrien + Member function templates are now supported. 6350397Sobrien + Partial specialization of class templates is now supported. 6450397Sobrien + Explicit specification of template parameters to function templates 6550397Sobrien is now supported. 6650397Sobrien 6750397Sobrien Things you may need to fix in your code: 6850397Sobrien 6950397Sobrien + Syntax errors in templates that are never instantiated will now be 7050397Sobrien diagnosed. 7150397Sobrien + Types and class templates used in templates must be declared 7250397Sobrien first, or the compiler will assume they are not types, and fail. 7350397Sobrien + Similarly, nested types of template type parameters must be tagged 7450397Sobrien with the 'typename' keyword, except in base lists. In many cases, 7550397Sobrien but not all, the compiler will tell you where you need to add 7650397Sobrien 'typename'. For more information, see 7750397Sobrien 7850397Sobrien http://www.cygnus.com/misc/wp/dec96pub/template.html#temp.res 7950397Sobrien 8050397Sobrien + Guiding declarations are no longer supported. Function declarations, 8150397Sobrien including friend declarations, do not refer to template instantiations. 8250397Sobrien You can restore the old behavior with -fguiding-decls until you fix 8350397Sobrien your code. 8450397Sobrien 8550397Sobrien Other features: 8650397Sobrien 8750397Sobrien + Default function arguments in templates will not be evaluated (or 8850397Sobrien checked for semantic validity) unless they are needed. Default 8950397Sobrien arguments in class bodies will not be parsed until the class 9050397Sobrien definition is complete. 9150397Sobrien + The -ftemplate-depth-NN flag can be used to increase the maximum 9250397Sobrien recursive template instantiation depth, which defaults to 17. If you 9350397Sobrien need to use this flag, the compiler will tell you. 9450397Sobrien + Explicit instantiation of template constructors and destructors is 9550397Sobrien now supported. For instance: 9650397Sobrien 9750397Sobrien template A<int>::A(const A&); 9850397Sobrien 9950397Sobrien Still not supported: 10050397Sobrien 10150397Sobrien + Member class templates. 10250397Sobrien + Template friends. 10350397Sobrien 10450397Sobrien* Exception handling support has been significantly improved and is on by 10550397Sobrien default. The compiler supports two mechanisms for walking back up the 10650397Sobrien call stack; one relies on static information about how registers are 10750397Sobrien saved, and causes no runtime overhead for code that does not throw 10850397Sobrien exceptions. The other mechanism uses setjmp and longjmp equivalents, and 10950397Sobrien can result in quite a bit of runtime overhead. You can determine which 11050397Sobrien mechanism is the default for your target by compiling a testcase that 11150397Sobrien uses exceptions and doing an 'nm' on the object file; if it uses __throw, 11250397Sobrien it's using the first mechanism. If it uses __sjthrow, it's using the 11350397Sobrien second. 11450397Sobrien 11550397Sobrien You can turn EH support off with -fno-exceptions. 11650397Sobrien 11750397Sobrien* RTTI support has been rewritten to work properly and is now on by default. 11850397Sobrien This means code that uses virtual functions will have a modest space 11950397Sobrien overhead. You can use the -fno-rtti flag to disable RTTI support. 12050397Sobrien 12150397Sobrien* On ELF systems, duplicate copies of symbols with 'initialized common' 12250397Sobrien linkage (such as template instantiations, vtables, and extern inlines) 12350397Sobrien will now be discarded by the GNU linker, so you don't need to use -frepo. 12450397Sobrien This support requires GNU ld from binutils 2.8 or later. 12550397Sobrien 12650397Sobrien* The overload resolution code has been rewritten to conform to the latest 12750397Sobrien C++ Working Paper. Built-in operators are now considered as candidates 12850397Sobrien in operator overload resolution. Function template overloading chooses 12950397Sobrien the more specialized template, and handles base classes in type deduction 13050397Sobrien and guiding declarations properly. In this release the old code can 13150397Sobrien still be selected with -fno-ansi-overloading, although this is not 13250397Sobrien supported and will be removed in a future release. 13350397Sobrien 13450397Sobrien* Standard usage syntax for the std namespace is supported; std is treated 13550397Sobrien as an alias for global scope. General namespaces are still not supported. 13650397Sobrien 13750397Sobrien* New flags: 13850397Sobrien 13950397Sobrien + New warning -Wno-pmf-conversion (don't warn about 14050397Sobrien converting from a bound member function pointer to function 14150397Sobrien pointer). 14250397Sobrien 14350397Sobrien + A flag -Weffc++ has been added for violations of some of the style 14450397Sobrien guidelines in Scott Meyers' _Effective C++_ books. 14550397Sobrien 14650397Sobrien + -Woverloaded-virtual now warns if a virtual function in a base 14750397Sobrien class is hidden in a derived class, rather than warning about 14850397Sobrien virtual functions being overloaded (even if all of the inherited 14950397Sobrien signatures are overridden) as it did before. 15050397Sobrien 15150397Sobrien + -Wall no longer implies -W. The new warning flag, -Wsign-compare, 15250397Sobrien included in -Wall, warns about dangerous comparisons of signed and 15350397Sobrien unsigned values. Only the flag is new; it was previously part of 15450397Sobrien -W. 15550397Sobrien 15650397Sobrien + The new flag, -fno-weak, disables the use of weak symbols. 15750397Sobrien 15850397Sobrien* Synthesized methods are now emitted in any translation units that need 15950397Sobrien an out-of-line copy. They are no longer affected by #pragma interface 16050397Sobrien or #pragma implementation. 16150397Sobrien 16250397Sobrien* __FUNCTION__ and __PRETTY_FUNCTION__ are now treated as variables by the 16350397Sobrien parser; previously they were treated as string constants. So code like 16450397Sobrien `printf (__FUNCTION__ ": foo")' must be rewritten to 16550397Sobrien `printf ("%s: foo", __FUNCTION__)'. This is necessary for templates. 16650397Sobrien 16750397Sobrien* local static variables in extern inline functions will be shared between 16850397Sobrien translation units. 16950397Sobrien 17050397Sobrien* -fvtable-thunks is supported for all targets, and is the default for 17150397Sobrien Linux with glibc 2.x (also called libc 6.x). 17250397Sobrien 17350397Sobrien* bool is now always the same size as another built-in type. Previously, 17450397Sobrien a 64-bit RISC target using a 32-bit ABI would have 32-bit pointers and a 17550397Sobrien 64-bit bool. This should only affect Irix 6, which was not supported in 17650397Sobrien 2.7.2. 17750397Sobrien 17850397Sobrien* new (nothrow) is now supported. 17950397Sobrien 18050397Sobrien* Synthesized destructors are no longer made virtual just because the class 18150397Sobrien already has virtual functions, only if they override a virtual destructor 18250397Sobrien in a base class. The compiler will warn if this affects your code. 18350397Sobrien 18450397Sobrien* The g++ driver now only links against libstdc++, not libg++; it is 18550397Sobrien functionally identical to the c++ driver. 18650397Sobrien 18750397Sobrien* (void *)0 is no longer considered a null pointer constant; NULL in 18850397Sobrien <stddef.h> is now defined as __null, a magic constant of type (void *) 18950397Sobrien normally, or (size_t) with -ansi. 19050397Sobrien 19150397Sobrien* The name of a class is now implicitly declared in its own scope; A::A 19250397Sobrien refers to A. 19350397Sobrien 19450397Sobrien* Local classes are now supported. 19550397Sobrien 19650397Sobrien* __attribute__ can now be attached to types as well as declarations. 19750397Sobrien 19850397Sobrien* The compiler no longer emits a warning if an ellipsis is used as a 19950397Sobrien function's argument list. 20050397Sobrien 20150397Sobrien* Definition of nested types outside of their containing class is now 20250397Sobrien supported. For instance: 20350397Sobrien 20450397Sobrien struct A { 20550397Sobrien struct B; 20650397Sobrien B* bp; 20750397Sobrien }; 20850397Sobrien 20950397Sobrien struct A::B { 21050397Sobrien int member; 21150397Sobrien }; 21250397Sobrien 21350397Sobrien* On the HPPA, some classes that do not define a copy constructor 21450397Sobrien will be passed and returned in memory again so that functions 21550397Sobrien returning those types can be inlined. 21650397Sobrien 21750397Sobrien*** The g++ team thanks everyone that contributed to this release, 21850397Sobrien but especially: 21950397Sobrien 22050397Sobrien* Joe Buck <jbuck@synopsys.com>, the maintainer of the g++ FAQ. 22150397Sobrien* Brendan Kehoe <brendan@cygnus.com>, who coordinates testing of g++. 22250397Sobrien* Jason Merrill <jason@cygnus.com>, the g++ maintainer. 22350397Sobrien* Mark Mitchell <mmitchell@usa.net>, who implemented member function 22450397Sobrien templates and explicit qualification of function templates. 22550397Sobrien* Mike Stump <mrs@wrs.com>, the previous g++ maintainer, who did most of 22650397Sobrien the exception handling work. 227