OSDN Git Service

* decl.c (cp_finish_decl): When bailing on a comdat variable, also
[pf3gnuchains/gcc-fork.git] / gcc / cp / NEWS
1 *** Changes since EGCS 1.0:
2
3 * Template template parameters are now supported.
4
5 * operator new now throws bad_alloc where appropriate.
6
7 *** Changes in EGCS 1.0:
8
9 * A public review copy of the December 1996 Draft of the ISO/ANSI C++
10   standard is now available. See
11
12         http://www.cygnus.com/misc/wp/
13
14   for more information.
15
16 * g++ now uses a new implementation of templates. The basic idea is that
17   now templates are minimally parsed when seen and then expanded later.
18   This allows conformant early name binding and instantiation controls,
19   since instantiations no longer have to go through the parser.
20
21   What you get:
22
23      + Inlining of template functions works without any extra effort or
24        modifications.
25      + Instantiations of class templates and methods defined in the class
26        body are deferred until they are actually needed (unless
27        -fexternal-templates is specified).
28      + Nested types in class templates work.
29      + Static data member templates work.
30      + Member function templates are now supported.
31      + Partial specialization of class templates is now supported.
32      + Explicit specification of template parameters to function templates
33        is now supported.
34
35   Things you may need to fix in your code:
36
37      + Syntax errors in templates that are never instantiated will now be
38        diagnosed.
39      + Types and class templates used in templates must be declared
40        first, or the compiler will assume they are not types, and fail.
41      + Similarly, nested types of template type parameters must be tagged
42        with the 'typename' keyword, except in base lists.  In many cases,
43        but not all, the compiler will tell you where you need to add
44        'typename'.  For more information, see
45
46             http://www.cygnus.com/misc/wp/dec96pub/template.html#temp.res
47
48      + Guiding declarations are no longer supported.  Function declarations, 
49        including friend declarations, do not refer to template instantiations.
50        You can restore the old behavior with -fguiding-decls until you fix
51        your code.
52
53   Other features:
54
55      + Default function arguments in templates will not be evaluated (or
56        checked for semantic validity) unless they are needed.  Default
57        arguments in class bodies will not be parsed until the class
58        definition is complete.
59      + The -ftemplate-depth-NN flag can be used to increase the maximum
60        recursive template instantiation depth, which defaults to 17. If you
61        need to use this flag, the compiler will tell you.
62      + Explicit instantiation of template constructors and destructors is
63        now supported.  For instance:
64
65             template A<int>::A(const A&);
66
67   Still not supported:
68
69      + Member class templates.
70      + Template friends.
71
72 * Exception handling support has been significantly improved and is on by
73   default.  The compiler supports two mechanisms for walking back up the
74   call stack; one relies on static information about how registers are
75   saved, and causes no runtime overhead for code that does not throw
76   exceptions.  The other mechanism uses setjmp and longjmp equivalents, and
77   can result in quite a bit of runtime overhead.  You can determine which
78   mechanism is the default for your target by compiling a testcase that
79   uses exceptions and doing an 'nm' on the object file; if it uses __throw,
80   it's using the first mechanism.  If it uses __sjthrow, it's using the
81   second.
82
83   You can turn EH support off with -fno-exceptions.
84
85 * RTTI support has been rewritten to work properly and is now on by default.
86   This means code that uses virtual functions will have a modest space
87   overhead.  You can use the -fno-rtti flag to disable RTTI support.
88
89 * On ELF systems, duplicate copies of symbols with 'initialized common'
90   linkage (such as template instantiations, vtables, and extern inlines)
91   will now be discarded by the GNU linker, so you don't need to use -frepo.
92   This support requires GNU ld from binutils 2.8 or later.
93
94 * The overload resolution code has been rewritten to conform to the latest
95   C++ Working Paper.  Built-in operators are now considered as candidates
96   in operator overload resolution.  Function template overloading chooses
97   the more specialized template, and handles base classes in type deduction
98   and guiding declarations properly.  In this release the old code can
99   still be selected with -fno-ansi-overloading, although this is not
100   supported and will be removed in a future release.
101
102 * Standard usage syntax for the std namespace is supported; std is treated
103   as an alias for global scope.  General namespaces are still not supported.
104
105 * New flags:
106
107      + New warning -Wno-pmf-conversion (don't warn about
108        converting from a bound member function pointer to function
109        pointer).
110
111      + A flag -Weffc++ has been added for violations of some of the style 
112        guidelines in Scott Meyers' _Effective C++_ books.
113
114      + -Woverloaded-virtual now warns if a virtual function in a base
115        class is hidden in a derived class, rather than warning about
116        virtual functions being overloaded (even if all of the inherited
117        signatures are overridden) as it did before.
118
119      + -Wall no longer implies -W.  The new warning flag, -Wsign-compare,
120         included in -Wall, warns about dangerous comparisons of signed and
121         unsigned values. Only the flag is new; it was previously part of
122         -W.
123
124      + The new flag, -fno-weak, disables the use of weak symbols.
125
126 * Synthesized methods are now emitted in any translation units that need
127   an out-of-line copy. They are no longer affected by #pragma interface
128   or #pragma implementation.
129
130 * __FUNCTION__ and __PRETTY_FUNCTION__ are now treated as variables by the
131   parser; previously they were treated as string constants.  So code like
132   `printf (__FUNCTION__ ": foo")' must be rewritten to 
133   `printf ("%s: foo", __FUNCTION__)'.  This is necessary for templates.
134
135 * local static variables in extern inline functions will be shared between
136   translation units.
137
138 * -fvtable-thunks is supported for all targets, and is the default for 
139   Linux with glibc 2.x (also called libc 6.x).
140
141 * bool is now always the same size as another built-in type. Previously,
142   a 64-bit RISC target using a 32-bit ABI would have 32-bit pointers and a
143   64-bit bool. This should only affect Irix 6, which was not supported in
144   2.7.2.
145
146 * new (nothrow) is now supported.
147
148 * Synthesized destructors are no longer made virtual just because the class
149   already has virtual functions, only if they override a virtual destructor
150   in a base class.  The compiler will warn if this affects your code.
151
152 * The g++ driver now only links against libstdc++, not libg++; it is
153   functionally identical to the c++ driver.
154
155 * (void *)0 is no longer considered a null pointer constant; NULL in
156   <stddef.h> is now defined as __null, a magic constant of type (void *)
157   normally, or (size_t) with -ansi.
158
159 * The name of a class is now implicitly declared in its own scope; A::A
160   refers to A.
161
162 * Local classes are now supported, though not inside templates.
163
164 * __attribute__ can now be attached to types as well as declarations.
165
166 * The compiler no longer emits a warning if an ellipsis is used as a
167   function's argument list.
168
169 * Definition of nested types outside of their containing class is now
170   supported.  For instance:
171
172        struct A {
173               struct B;
174               B* bp;
175        };
176
177        struct A::B {
178               int member;
179        };
180
181 * On the HPPA, some classes that do not define a copy constructor
182   will be passed and returned in memory again so that functions
183   returning those types can be inlined.
184
185 *** The g++ team thanks everyone that contributed to this release,
186     but especially:
187
188 * Joe Buck <jbuck@synopsys.com>, the maintainer of the g++ FAQ.
189 * Brendan Kehoe <brendan@cygnus.com>, who coordinates testing of g++.
190 * Jason Merrill <jason@cygnus.com>, the g++ maintainer.
191 * Mark Mitchell <mmitchell@usa.net>, who implemented member function 
192   templates and explicit qualification of function templates.
193 * Mike Stump <mrs@wrs.com>, the previous g++ maintainer, who did most of
194   the exception handling work.