aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@yorick.cygnus.com>1999-08-09 02:30:21 +0000
committerJason Merrill <jason@gcc.gnu.org>1999-08-08 22:30:21 -0400
commitf3e4d63c924af4eab9bacf989db3d5187ca316ab (patch)
tree67145bc3dd60898a6dd39bf5df997819d9ce78fa /gcc
parentcb35be5713a3a2a28d06aabf364d12f5dd67e8d9 (diff)
downloadgcc-f3e4d63c924af4eab9bacf989db3d5187ca316ab.zip
gcc-f3e4d63c924af4eab9bacf989db3d5187ca316ab.tar.gz
gcc-f3e4d63c924af4eab9bacf989db3d5187ca316ab.tar.bz2
ptree.c (print_lang_type): Print the real type of a PMF.
* ptree.c (print_lang_type): Print the real type of a PMF. Print what exceptions a fn type throws. * typeck.c (common_type): Use same_type_p. And revert: * decl.c (bad_specifiers): It's OK to have an EH spec on a function pointer. From-SVN: r28609
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog10
-rw-r--r--gcc/cp/decl.c2
-rw-r--r--gcc/cp/ptree.c22
-rw-r--r--gcc/cp/typeck.c2
4 files changed, 29 insertions, 7 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 0e0b5a5..41037ae 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,10 @@
+1999-08-08 Jason Merrill <jason@yorick.cygnus.com>
+
+ * ptree.c (print_lang_type): Print the real type of a PMF.
+ Print what exceptions a fn type throws.
+
+ * typeck.c (common_type): Use same_type_p.
+
1999-08-07 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* class.c (count_fields, add_fields_to_vec): Add static prototype.
@@ -37,9 +44,6 @@
1999-08-06 Jason Merrill <jason@yorick.cygnus.com>
- * decl.c (bad_specifiers): It's OK to have an EH spec on a function
- pointer.
-
* pt.c (maybe_get_template_decl_from_type_decl): Make sure that
we're looking at a class.
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 83e408e..27f915c 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -8363,7 +8363,7 @@ bad_specifiers (object, type, virtualp, quals, inlinep, friendp, raises)
object, type);
if (friendp)
cp_error_at ("`%D' declared as a friend", object);
- if (raises && ! TYPE_PTRFN_P (TREE_TYPE (object)))
+ if (raises)
cp_error_at ("`%D' declared with an exception specification", object);
}
diff --git a/gcc/cp/ptree.c b/gcc/cp/ptree.c
index 3c84864..0f7a7cb 100644
--- a/gcc/cp/ptree.c
+++ b/gcc/cp/ptree.c
@@ -73,9 +73,10 @@ print_lang_type (file, node, indent)
register tree node;
int indent;
{
- if (TREE_CODE (node) == TEMPLATE_TYPE_PARM
- || TREE_CODE (node) == TEMPLATE_TEMPLATE_PARM)
+ switch (TREE_CODE (node))
{
+ case TEMPLATE_TYPE_PARM:
+ case TEMPLATE_TEMPLATE_PARM:
indent_to (file, indent + 3);
fputs ("index ", file);
fprintf (file, HOST_WIDE_INT_PRINT_DEC, TEMPLATE_TYPE_IDX (node));
@@ -84,8 +85,25 @@ print_lang_type (file, node, indent)
fputs (" orig_level ", file);
fprintf (file, HOST_WIDE_INT_PRINT_DEC, TEMPLATE_TYPE_ORIG_LEVEL (node));
return;
+
+ case FUNCTION_TYPE:
+ case METHOD_TYPE:
+ if (TYPE_RAISES_EXCEPTIONS (node))
+ print_node (file, "throws", TYPE_RAISES_EXCEPTIONS (node), indent + 4);
+ return;
+
+ case RECORD_TYPE:
+ case UNION_TYPE:
+ break;
+
+ default:
+ return;
}
+ if (TYPE_PTRMEMFUNC_P (node))
+ print_node (file, "ptrmemfunc fn type", TYPE_PTRMEMFUNC_FN_TYPE (node),
+ indent + 4);
+
if (! CLASS_TYPE_P (node))
return;
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index 991234c..8724548 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -699,7 +699,7 @@ common_type (t1, t2)
tt1 = TYPE_MAIN_VARIANT (tt1);
tt2 = TYPE_MAIN_VARIANT (tt2);
- if (tt1 == tt2)
+ if (same_type_p (tt1, tt2))
target = tt1;
else if (b1)
{