OSDN Git Service

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