diff options
author | Jason Merrill <jason@gcc.gnu.org> | 1999-01-18 07:49:20 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 1999-01-18 07:49:20 -0500 |
commit | ddaed37e0437fb5d5c9446139d4938d3e51532cb (patch) | |
tree | 3bae4ffe519aaa727042fb46d83af587564753b2 /gcc | |
parent | 8c7707b030e111b02c9398436a7600f0a4447618 (diff) | |
download | gcc-ddaed37e0437fb5d5c9446139d4938d3e51532cb.zip gcc-ddaed37e0437fb5d5c9446139d4938d3e51532cb.tar.gz gcc-ddaed37e0437fb5d5c9446139d4938d3e51532cb.tar.bz2 |
typeck.c (comp_ptr_ttypes_reinterpret): Per ANSI, tighten up definition of 'casting away const' in reinterpret_cast<>.
* typeck.c (comp_ptr_ttypes_reinterpret): Per ANSI, tighten up
definition of 'casting away const' in reinterpret_cast<>.
* cvt.c: Add include for decl.h, remove extern for
static_aggregates which is now provided by decl.h.
* Makefile.in (cvt.o): Add dependency for decl.h and missing
dependencies for convert.h and flags.h.
* decl2.c (do_dtors): Set current location to that of the
decl, for sensible diagnostics and debugging.
(check_classfn): Issue `incomplete type' error, if
class is not defined.
* cp-tree.h: Add prototype for bound_pmf_p.
From-SVN: r24748
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 24 | ||||
-rw-r--r-- | gcc/cp/Makefile.in | 4 | ||||
-rw-r--r-- | gcc/cp/cp-tree.h | 1 | ||||
-rw-r--r-- | gcc/cp/cvt.c | 3 | ||||
-rw-r--r-- | gcc/cp/decl2.c | 13 | ||||
-rw-r--r-- | gcc/cp/typeck.c | 9 |
6 files changed, 43 insertions, 11 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 554d85f..dfe2645 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,27 @@ +1999-01-18 Chip Salzenberg <chip@perlsupport.com> + + * typeck.c (comp_ptr_ttypes_reinterpret): Per ANSI, tighten up + definition of 'casting away const' in reinterpret_cast<>. + +1999-01-18 Graham <grahams@rcp.co.uk> + + * cvt.c: Add include for decl.h, remove extern for + static_aggregates which is now provided by decl.h. + + * Makefile.in (cvt.o): Add dependency for decl.h and missing + dependencies for convert.h and flags.h. + +1999-01-18 Nathan Sidwell <nathan@acm.org> + + * decl2.c (do_dtors): Set current location to that of the + decl, for sensible diagnostics and debugging. + (check_classfn): Issue `incomplete type' error, if + class is not defined. + +1999-01-16 Jason Merrill <jason@yorick.cygnus.com> + + * cp-tree.h: Add prototype for bound_pmf_p. + 1999-01-16 Jason Merrill <jason@yorick.cygnus.com> Manfred Hollstein <manfred@s-direktnet.de> diff --git a/gcc/cp/Makefile.in b/gcc/cp/Makefile.in index 9fc861a..fd4f5c0 100644 --- a/gcc/cp/Makefile.in +++ b/gcc/cp/Makefile.in @@ -269,8 +269,8 @@ init.o : init.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h $(RTL_H) \ $(EXPR_H) $(srcdir)/../system.h $(srcdir)/../toplev.h method.o : method.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../system.h \ $(srcdir)/../toplev.h -cvt.o : cvt.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../system.h \ - $(srcdir)/../toplev.h +cvt.o : cvt.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../system.h decl.h \ + $(srcdir)/../flags.h $(srcdir)/../toplev.h $(srcdir)/../convert.h search.o : search.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../stack.h \ $(srcdir)/../flags.h $(srcdir)/../system.h $(srcdir)/../toplev.h tree.o : tree.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h \ diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index fb80e38..18f697a 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -3259,6 +3259,7 @@ extern int count_functions PROTO((tree)); extern int is_overloaded_fn PROTO((tree)); extern tree get_first_fn PROTO((tree)); extern tree binding_init PROTO((struct tree_binding*)); +extern int bound_pmf_p PROTO((tree)); extern tree ovl_cons PROTO((tree, tree)); extern tree scratch_ovl_cons PROTO((tree, tree)); extern int ovl_member PROTO((tree, tree)); diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c index d112096..2b0cd53 100644 --- a/gcc/cp/cvt.c +++ b/gcc/cp/cvt.c @@ -32,8 +32,7 @@ Boston, MA 02111-1307, USA. */ #include "cp-tree.h" #include "convert.h" #include "toplev.h" - -extern tree static_aggregates; +#include "decl.h" static tree cp_convert_to_pointer PROTO((tree, tree)); static tree convert_to_pointer_force PROTO((tree, tree)); diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index 0ca5753..9ca09cb 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -1455,8 +1455,11 @@ check_classfn (ctype, function) else { methods = 0; - cp_error ("no `%#D' member function declared in class `%T'", - function, ctype); + if (TYPE_SIZE (ctype) == 0) + incomplete_type_error (function, ctype); + else + cp_error ("no `%#D' member function declared in class `%T'", + function, ctype); } /* If we did not find the method in the class, add it to avoid @@ -3094,6 +3097,12 @@ do_dtors (start) if (! current_function_decl) start_objects ('D', initp); + /* Set these global variables so that GDB at least puts + us near the declaration which required the initialization. */ + input_filename = DECL_SOURCE_FILE (decl); + lineno = DECL_SOURCE_LINE (decl); + emit_note (input_filename, lineno); + /* Because of: [class.access.spec] diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index 4fb4f59..662cb50 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -7439,12 +7439,10 @@ comp_ptr_ttypes_reinterpret (to, from) if (TREE_CODE (to) == OFFSET_TYPE) to = TREE_TYPE (to); - if (TREE_CODE (to) != TREE_CODE (from)) - return 1; - /* Const and volatile mean something different for function types, so the usual checks are not appropriate. */ - if (TREE_CODE (to) != FUNCTION_TYPE && TREE_CODE (to) != METHOD_TYPE) + if (TREE_CODE (from) != FUNCTION_TYPE && TREE_CODE (from) != METHOD_TYPE + && TREE_CODE (to) != FUNCTION_TYPE && TREE_CODE (to) != METHOD_TYPE) { if (!at_least_as_qualified_p (to, from)) return 0; @@ -7455,7 +7453,8 @@ comp_ptr_ttypes_reinterpret (to, from) constp &= TYPE_READONLY (to); } - if (TREE_CODE (to) != POINTER_TYPE) + if (TREE_CODE (from) != POINTER_TYPE + || TREE_CODE (to) != POINTER_TYPE) return 1; } } |