summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>1997-11-26 09:56:56 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>1997-11-26 09:56:56 +0000
commitb66841669114d7da06eae1671f8481a75d30750e (patch)
tree4cef68567ca34f5bf3cb90489475575c775c30bb /gcc
parent1f6f6d8b2269e387281564390c6883536984a236 (diff)
downloadgcc-b66841669114d7da06eae1671f8481a75d30750e.tar.gz
* typeck2.c (digest_init): Make copies where appropriate.
* decl2.c (delete_sanity): resolve_offset_ref. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@16727 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog4
-rw-r--r--gcc/cp/NEWS25
-rw-r--r--gcc/cp/decl2.c10
-rw-r--r--gcc/cp/typeck2.c3
4 files changed, 30 insertions, 12 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index a129f0a9a52..dbe470e464e 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,9 @@
Wed Nov 26 01:11:24 1997 Jason Merrill <jason@yorick.cygnus.com>
+ * typeck2.c (digest_init): Make copies where appropriate.
+
+ * decl2.c (delete_sanity): resolve_offset_ref.
+
* except.c (expand_start_catch_block): Fix catching a reference
to pointer.
diff --git a/gcc/cp/NEWS b/gcc/cp/NEWS
index ff2d5124f52..7548830396d 100644
--- a/gcc/cp/NEWS
+++ b/gcc/cp/NEWS
@@ -1,7 +1,7 @@
*** Changes since G++ version 2.7.2:
-* A public review copy of the December 1996 Draft of the ANSI/ISO C++
- proto-standard is now available. See
+* A public review copy of the December 1996 Draft of the ISO/ANSI C++
+ standard is now available. See
http://www.cygnus.com/misc/wp/
@@ -65,8 +65,17 @@
+ Template friends.
* Exception handling support has been significantly improved and is on by
- default. This can result in significant runtime overhead. You can turn
- it off with -fno-exceptions.
+ default. The compiler supports two mechanisms for walking back up the
+ call stack; one relies on static information about how registers are
+ saved, and causes no runtime overhead for code that does not throw
+ exceptions. The other mechanism uses setjmp and longjmp equivalents, and
+ can result in quite a bit of runtime overhead. You can determine which
+ mechanism is the default for your target by compiling a testcase that
+ uses exceptions and doing an 'nm' on the object file; if it uses __throw,
+ it's using the first mechanism. If it uses __sjthrow, it's using the
+ second.
+
+ You can turn EH support off with -fno-exceptions.
* RTTI support has been rewritten to work properly and is now on by default.
This means code that uses virtual functions will have a modest space
@@ -90,9 +99,9 @@
* New flags:
- + New flags -Wsign-promo (warn about potentially confusing promotions
- in overload resolution), -Wno-pmf-conversion (don't warn about
- converting from a bound member function pointer to function pointer).
+ + New warning -Wno-pmf-conversion (don't warn about
+ converting from a bound member function pointer to function
+ pointer).
+ A flag -Weffc++ has been added for violations of some of the style
guidelines in Scott Meyers' _Effective C++_ books.
@@ -145,7 +154,7 @@
* The name of a class is now implicitly declared in its own scope; A::A
refers to A.
-* Local classes are now supported.
+* Local classes are now supported, though not inside templates.
* __attribute__ can now be attached to types as well as declarations.
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 3821cf33dea..7f207d63816 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -1242,7 +1242,10 @@ delete_sanity (exp, size, doing_vec, use_global_delete)
return t;
}
- t = stabilize_reference (convert_from_reference (exp));
+ t = exp;
+ if (TREE_CODE (t) == OFFSET_REF)
+ t = resolve_offset_ref (t);
+ t = stabilize_reference (convert_from_reference (t));
type = TREE_TYPE (t);
code = TREE_CODE (type);
@@ -1270,15 +1273,14 @@ delete_sanity (exp, size, doing_vec, use_global_delete)
if (code == POINTER_TYPE)
{
#if 0
- /* As of Valley Forge, you can delete a pointer to constant. */
- /* You can't delete a pointer to constant. */
+ /* As of Valley Forge, you can delete a pointer to const. */
if (TREE_READONLY (TREE_TYPE (type)))
{
error ("`const *' cannot be deleted");
return error_mark_node;
}
#endif
- /* You also can't delete functions. */
+ /* You can't delete functions. */
if (TREE_CODE (TREE_TYPE (type)) == FUNCTION_TYPE)
{
error ("cannot delete a function");
diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c
index d876e76806f..24e3c5cf08b 100644
--- a/gcc/cp/typeck2.c
+++ b/gcc/cp/typeck2.c
@@ -743,6 +743,9 @@ digest_init (type, init, tail)
init = DECL_INITIAL (init);
else if (TREE_READONLY_DECL_P (init))
init = decl_constant_value (init);
+ else if (IS_AGGR_TYPE (type) && TYPE_NEEDS_CONSTRUCTING (type))
+ init = ocp_convert (type, init, CONV_IMPLICIT|CONV_FORCE_TEMP,
+ LOOKUP_NORMAL);
return init;
}