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