call.c (add_builtin_candidates): Use cv_unqualified rather than TYPE_MAIN_VARIANT.
authorJason Merrill <jason@redhat.com>
Tue, 21 Jun 2011 19:05:33 +0000 (15:05 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Tue, 21 Jun 2011 19:05:33 +0000 (15:05 -0400)
* call.c (add_builtin_candidates): Use cv_unqualified rather than
TYPE_MAIN_VARIANT.
* pt.c (tsubst_arg_types): Likewise.
* except.c (build_throw): Use cv_unqualified.

From-SVN: r175272

gcc/cp/ChangeLog
gcc/cp/call.c
gcc/cp/except.c
gcc/cp/pt.c

index 558e756fe553b150f6be8f77704dfdcf16908f56..4fc801761912d1800aea9041108708417b1a5d8e 100644 (file)
@@ -1,5 +1,10 @@
 2011-06-21  Jason Merrill  <jason@redhat.com>
 
+       * call.c (add_builtin_candidates): Use cv_unqualified rather than
+       TYPE_MAIN_VARIANT.
+       * pt.c (tsubst_arg_types): Likewise.
+       * except.c (build_throw): Use cv_unqualified.
+
        PR c++/49418
        * call.c (cxx_type_promotes_to): Don't strip cv-quals.
        * semantics.c (lambda_return_type): Strip them here.
index 3ac7a8e3f5445a365d36119c3a1f4dd4f06b367d..8123e3dd25237584f1507d9c071d2f13c023383e 100644 (file)
@@ -2773,7 +2773,7 @@ add_builtin_candidates (struct z_candidate **candidates, enum tree_code code,
              type = non_reference (type);
              if (i != 0 || ! ref1)
                {
-                 type = TYPE_MAIN_VARIANT (type_decays_to (type));
+                 type = cv_unqualified (type_decays_to (type));
                  if (enum_p && TREE_CODE (type) == ENUMERAL_TYPE)
                    VEC_safe_push (tree, gc, types[i], type);
                  if (INTEGRAL_OR_UNSCOPED_ENUMERATION_TYPE_P (type))
@@ -2792,7 +2792,7 @@ add_builtin_candidates (struct z_candidate **candidates, enum tree_code code,
          type = non_reference (argtypes[i]);
          if (i != 0 || ! ref1)
            {
-             type = TYPE_MAIN_VARIANT (type_decays_to (type));
+             type = cv_unqualified (type_decays_to (type));
              if (enum_p && UNSCOPED_ENUM_P (type))
                VEC_safe_push (tree, gc, types[i], type);
              if (INTEGRAL_OR_UNSCOPED_ENUMERATION_TYPE_P (type))
index 3399652241f4985a7854edb8bc2dac33a49839c1..f8c8e4734a8c4a16beb8a42c65879f7c8f4f3717 100644 (file)
@@ -722,7 +722,7 @@ build_throw (tree exp)
         respectively.  */
       temp_type = is_bitfield_expr_with_lowered_type (exp);
       if (!temp_type)
-       temp_type = type_decays_to (TREE_TYPE (exp));
+       temp_type = cv_unqualified (type_decays_to (TREE_TYPE (exp)));
 
       /* OK, this is kind of wacky.  The standard says that we call
         terminate when the exception handling mechanism, after
index 4d2caa883078ba45c9486011d7e58dea18a26bb7..2716f7831233d68eebc06395bac6311dfaf1e323 100644 (file)
@@ -10246,7 +10246,7 @@ tsubst_arg_types (tree arg_types,
     
     /* Do array-to-pointer, function-to-pointer conversion, and ignore
        top-level qualifiers as required.  */
-    type = TYPE_MAIN_VARIANT (type_decays_to (type));
+    type = cv_unqualified (type_decays_to (type));
 
     /* We do not substitute into default arguments here.  The standard
        mandates that they be instantiated only when needed, which is