aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/tree.c
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@codesourcery.com>2004-04-02 11:48:56 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2004-04-02 11:48:56 +0000
commit2e9ceb77befba5b08e2e27eeed70550e5be570b2 (patch)
tree13ad1a30020e4179013face1ceb42aab4c129129 /gcc/cp/tree.c
parentefe4ba3d352d1e1e4badcfa4982ad3007b94ef51 (diff)
downloadgcc-2e9ceb77befba5b08e2e27eeed70550e5be570b2.zip
gcc-2e9ceb77befba5b08e2e27eeed70550e5be570b2.tar.gz
gcc-2e9ceb77befba5b08e2e27eeed70550e5be570b2.tar.bz2
re PR c++/14007 (Incorrect use of const partial specialization for reference template argument)
cp: PR c++/14007 * pt.c (check_cv_quals_for_unify): Correct logic for disallowed cv-qualifier unification. * tree.c (cp_build_qualified_type_real): Renable DR295 logic. testsuite: PR c++/14007 * g++.dg/template/unify5.C: New. * g++.dg/template/unify6.C: New. * g++.dg/template/qualttp20.C: Adjust. * g++.old-deja/g++.jason/report.C: Adjust. * g++.old-deja/g++.other/qual1.C: Adjust. From-SVN: r80351
Diffstat (limited to 'gcc/cp/tree.c')
-rw-r--r--gcc/cp/tree.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index afa5c4b..adf3b39 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -433,11 +433,6 @@ cp_build_qualified_type_real (tree type,
{
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;
@@ -507,8 +502,6 @@ cp_build_qualified_type_real (tree type,
|| 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);
}
@@ -527,21 +520,17 @@ cp_build_qualified_type_real (tree type,
/*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)
- || bad_func_quals)
+ if (!(complain & tf_ignore_bad_quals))
error ("`%V' qualifiers cannot be applied to `%T'",
bad_type, type);
}