aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/tree.c
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@codesourcery.com>2002-09-16 19:09:05 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2002-09-16 19:09:05 +0000
commit171d2f505b1b9e8d3fe2dd29d364e3933d3412ed (patch)
tree86d1c4d6293cc1c33df7aaf0421d329757c253b0 /gcc/cp/tree.c
parent0e9cab878b247613564e51cd98c3bac34411b628 (diff)
downloadgcc-171d2f505b1b9e8d3fe2dd29d364e3933d3412ed.zip
gcc-171d2f505b1b9e8d3fe2dd29d364e3933d3412ed.tar.gz
gcc-171d2f505b1b9e8d3fe2dd29d364e3933d3412ed.tar.bz2
Remove DR 295 implementation.
cp: Remove DR 295 implementation. * pt.c (check_cv_quals_for_unify): Disable function & method cases. * tree.c (cp_build_qualified_type_real): Likewise. Don't warn about ignoring volatile qualifiers. * search.c (lookup_member): Correct documentation. testsuite: * g++.dg/template/qualttp20.C: Adjust expected errors. * g++.old-deja/g++.jason/report.C: Likewise. * g++.old-deja/g++.other/qual1.C: Likewise. From-SVN: r57209
Diffstat (limited to 'gcc/cp/tree.c')
-rw-r--r--gcc/cp/tree.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 44a013c..ab7751b 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -577,6 +577,11 @@ cp_build_qualified_type_real (type, type_quals, complain)
{
tree result;
int bad_quals = TYPE_UNQUALIFIED;
+ /* We keep bad function qualifiers separate, so that we can decide
+ whether to implement DR 295 or not. DR 295 break existing code,
+ unfortunately. Remove this variable to implement the defect
+ report. */
+ int bad_func_quals = TYPE_UNQUALIFIED;
if (type == error_mark_node)
return type;
@@ -592,6 +597,8 @@ cp_build_qualified_type_real (type, type_quals, complain)
|| TREE_CODE (type) == METHOD_TYPE))
{
bad_quals |= type_quals & (TYPE_QUAL_CONST | TYPE_QUAL_VOLATILE);
+ if (TREE_CODE (type) != REFERENCE_TYPE)
+ bad_func_quals |= type_quals & (TYPE_QUAL_CONST | TYPE_QUAL_VOLATILE);
type_quals &= ~(TYPE_QUAL_CONST | TYPE_QUAL_VOLATILE);
}
@@ -610,21 +617,23 @@ cp_build_qualified_type_real (type, type_quals, complain)
/*OK*/;
else if (!(complain & (tf_error | tf_ignore_bad_quals)))
return error_mark_node;
+ else if (bad_func_quals && !(complain & tf_error))
+ return error_mark_node;
else
{
if (complain & tf_ignore_bad_quals)
/* We're not going to warn about constifying things that can't
be constified. */
bad_quals &= ~TYPE_QUAL_CONST;
+ bad_quals |= bad_func_quals;
if (bad_quals)
{
tree bad_type = build_qualified_type (ptr_type_node, bad_quals);
- if (!(complain & tf_ignore_bad_quals))
+ if (!(complain & tf_ignore_bad_quals)
+ || bad_func_quals)
error ("`%V' qualifiers cannot be applied to `%T'",
bad_type, type);
- else if (complain & tf_warning)
- warning ("ignoring `%V' qualifiers on `%T'", bad_type, type);
}
}