1 *** Changes since G++ version 2.7.2:
3 * A public review copy of the December 1996 Draft of the ANSI C++
4 proto-standard is now available. See
6 http://www.cygnus.com/misc/wp/
10 * Member function templates are now supported.
12 * New flags -Wsign-promo (warn about potentially confusing promotions in
13 overload resolution), -Wno-pmf-conversion (don't warn about converting
14 from a bound member function pointer to function pointer).
16 * local static variables in extern inline functions will be shared between
19 * Standard usage syntax for the std namespace is supported; std is treated
20 as an alias for global scope. General namespaces are still not supported.
22 * -fvtable-thunks is supported for all targets, and is the default for
23 Linux with glibc (libc 6 on x86).
25 * Default function arguments in templates will not be evaluated (or
26 checked for semantic validity) unless they are needed. Default arguments
27 in class bodies will not be parsed until the class definition is complete.
29 * The -ftemplate-depth-NN flag can be used to increase the maximum
30 recursive template instantiation depth, defaulting to 17. If you need
31 to use this flag, the compiler will tell you.
33 * The internal interface between RTTI-using code and the RTTI support
34 library has changed, so code that uses dynamic_cast should be
35 recompiled. The RTTI support library has moved from libstdc++ to
36 libgcc, so you no longer need to link against libstdc++ for a program
37 that doesn't use the "hosted" library.
39 * bool is now always the same size as another built-in type. Previously,
40 a 64-bit RISC target using a 32-bit ABI would have 32-bit pointers and a
41 64-bit bool. This should only affect Irix 6, which was not supported in
44 * new (nothrow) is now supported.
46 * A flag -Weffc++ has been added for violations of some of the style
47 guidelines in Scott Meyers' _Effective C++_ books.
49 * On ELF systems, duplicate copies of symbols with 'initialized common'
50 linkage (such as template instantiations, vtables, and extern inlines)
51 will now be discarded by the GNU linker, so you don't need to use -frepo.
52 This support requires GNU ld from binutils 2.8 or later.
54 * Partial specialization of class templates is now supported.
56 * The overload resolution code has been rewritten to conform to the latest
57 C++ Working Paper. Built-in operators are now considered as candidates
58 in operator overload resolution. Function template overloading chooses
59 the more specialized template, and handles base classes in type deduction
60 and guiding declarations properly. In this release the old code can
61 still be selected with -fno-ansi-overloading, although this is not
62 supported and will be removed in a future release.
64 * RTTI support has been rewritten to work properly and is now on by default.
65 This means code that uses virtual functions will have a modest space
66 overhead. You can use the -fno-rtti flag to disable RTTI support.
68 * Synthesized destructors are no longer made virtual just because the class
69 already has virtual functions, only if they override a virtual destructor
70 in a base class. The compiler will warn if this affects your code.
72 * The g++ driver now only links against libstdc++, not libg++; it is
73 functionally identical to the c++ driver.
75 * (void *)0 is no longer considered a null pointer constant; NULL in
76 <stddef.h> is now defined as __null, a magic constant of type (void *)
77 normally, or (size_t) with -ansi.
79 * The new 'template <>' specialization syntax is now accepted and ignored.
81 * The name of a class is now implicitly declared in its own scope; A::A
84 * g++ now uses a new implementation of templates. The basic idea is that
85 now templates are minimally parsed when seen and then expanded later.
86 This allows conformant early name binding and instantiation controls,
87 since instantiations no longer have to go through the parser.
91 + Inlining of template functions works without any extra effort or
93 + Instantiations of class templates and methods defined in the class
94 body are deferred until they are actually needed (unless
95 -fexternal-templates is specified).
96 + Nested types in class templates work.
97 + Static data member templates work.
101 + Types and class templates used in templates must be declared
102 first, or the compiler will assume they are not types, and fail.
103 + Similarly, nested types of template type parameters must be tagged
104 with the 'typename' keyword. In many cases, the compiler will tell
105 you where you need to add 'typename'.
106 + Syntax errors in templates that are never instantiated will now be
112 + Template template parameters.
114 * Synthesized methods are now emitted in any translation units that need
115 an out-of-line copy. They are no longer affected by #pragma interface
116 or #pragma implementation.
118 * Local classes are now supported.
120 * -Wall no longer implies -W.
121 The new warning flag, -Wsign-compare, included in -Wall, warns about
122 dangerous comparisons of signed and unsigned values. Only the flag is
123 new; it was previously part of -W.
125 * The new flag, -fno-weak, disables the use of weak symbols.
127 * __attribute__ can now be attached to types as well as declarations.
129 * -Woverloaded-virtual now warns if a virtual function in a base class is
130 hidden in a derived class, rather than warning about virtual functions
131 being overloaded (even if all of the inherited signatures are
132 overridden) as it did before.
134 * The compiler no longer emits a warning if an ellipsis is used as a
135 function's argument list.
137 * Exception handling support has been significantly improved and is on by
138 default. This can result in significant runtime overhead. You can turn
139 it off with -fno-exceptions.
141 * Definition of nested types outside of their containing class is now
142 supported. Use the following source code, as an example.
153 * Explicit instantiation of template constructors and destructors is now
154 supported. Use the following source code, as an example.
156 template A<int>::A(const A&);
158 * On the HPPA, some classes that do not define a copy constructor
159 will be passed and returned in memory again so that functions
160 returning those types can be inlined.