summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
5004fa1)
* tree.c (cv_unqualified): Handle error_mark_node.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158801
138bc75d-0d04-0410-961f-
82ee72b054a4
2010-04-27 Jason Merrill <jason@redhat.com>
2010-04-27 Jason Merrill <jason@redhat.com>
+ PR c++/43790
+ * tree.c (cv_unqualified): Handle error_mark_node.
+
PR c++/41468
* call.c (convert_like_real) [ck_ambig]: Just return error_mark_node
if we don't want errors.
PR c++/41468
* call.c (convert_like_real) [ck_ambig]: Just return error_mark_node
if we don't want errors.
#include "tree.h"
#include "cp-tree.h"
#include "flags.h"
#include "tree.h"
#include "cp-tree.h"
#include "flags.h"
#include "rtl.h"
#include "toplev.h"
#include "insn-config.h"
#include "rtl.h"
#include "toplev.h"
#include "insn-config.h"
if (error_operand_p (expr))
return expr;
if (error_operand_p (expr))
return expr;
- expr = mark_rvalue_use (expr);
-
/* [basic.lval]
Non-class rvalues always have cv-unqualified types. */
/* [basic.lval]
Non-class rvalues always have cv-unqualified types. */
}
/* A reference or method type shall not be cv-qualified.
}
/* A reference or method type shall not be cv-qualified.
- [dcl.ref], [dcl.fct]. This used to be an error, but as of DR 295
- (in CD1) we always ignore extra cv-quals on functions. */
+ [dcl.ref], [dcl.fct] */
if (type_quals & (TYPE_QUAL_CONST | TYPE_QUAL_VOLATILE)
&& (TREE_CODE (type) == REFERENCE_TYPE
if (type_quals & (TYPE_QUAL_CONST | TYPE_QUAL_VOLATILE)
&& (TREE_CODE (type) == REFERENCE_TYPE
- || TREE_CODE (type) == FUNCTION_TYPE
|| TREE_CODE (type) == METHOD_TYPE))
{
|| TREE_CODE (type) == METHOD_TYPE))
{
- if (TREE_CODE (type) == REFERENCE_TYPE)
- bad_quals |= type_quals & (TYPE_QUAL_CONST | TYPE_QUAL_VOLATILE);
+ bad_quals |= type_quals & (TYPE_QUAL_CONST | TYPE_QUAL_VOLATILE);
type_quals &= ~(TYPE_QUAL_CONST | TYPE_QUAL_VOLATILE);
}
type_quals &= ~(TYPE_QUAL_CONST | TYPE_QUAL_VOLATILE);
}
- /* But preserve any function-cv-quals on a FUNCTION_TYPE. */
- if (TREE_CODE (type) == FUNCTION_TYPE)
- type_quals |= type_memfn_quals (type);
-
/* A restrict-qualified type must be a pointer (or reference)
to object or incomplete type. */
if ((type_quals & TYPE_QUAL_RESTRICT)
/* A restrict-qualified type must be a pointer (or reference)
to object or incomplete type. */
if ((type_quals & TYPE_QUAL_RESTRICT)
type_quals &= ~TYPE_QUAL_RESTRICT;
}
type_quals &= ~TYPE_QUAL_RESTRICT;
}
- if (bad_quals == TYPE_UNQUALIFIED
- || (complain & tf_ignore_bad_quals))
+ if (bad_quals == TYPE_UNQUALIFIED)
- else if (!(complain & tf_error))
+ else if (!(complain & (tf_error | tf_ignore_bad_quals)))
return error_mark_node;
else
{
return error_mark_node;
else
{
- tree bad_type = build_qualified_type (ptr_type_node, bad_quals);
- error ("%qV qualifiers cannot be applied to %qT",
- bad_type, type);
+ 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;
+ if (bad_quals)
+ {
+ tree bad_type = build_qualified_type (ptr_type_node, bad_quals);
+
+ if (!(complain & tf_ignore_bad_quals))
+ error ("%qV qualifiers cannot be applied to %qT",
+ bad_type, type);
+ }
}
/* Retrieve (or create) the appropriately qualified variant. */
}
/* Retrieve (or create) the appropriately qualified variant. */
if (type == error_mark_node)
return type;
if (type == error_mark_node)
return type;
- quals = cp_type_quals (type);
+ quals = TYPE_QUALS (type);
quals &= ~(TYPE_QUAL_CONST|TYPE_QUAL_VOLATILE);
return cp_build_qualified_type (type, quals);
}
quals &= ~(TYPE_QUAL_CONST|TYPE_QUAL_VOLATILE);
return cp_build_qualified_type (type, quals);
}
TREE_CHAIN (arg_types));
}
else
TREE_CHAIN (arg_types));
}
else
result = build_function_type (type,
arg_types);
result = build_function_type (type,
arg_types);
- result = apply_memfn_quals (result, type_memfn_quals (t));
- }
if (TYPE_RAISES_EXCEPTIONS (t))
result = build_exception_variant (result,
if (TYPE_RAISES_EXCEPTIONS (t))
result = build_exception_variant (result,
+get_first_fn (tree from)
{
gcc_assert (is_overloaded_fn (from));
/* A baselink is also considered an overloaded function. */
{
gcc_assert (is_overloaded_fn (from));
/* A baselink is also considered an overloaded function. */
from = BASELINK_FUNCTIONS (from);
if (TREE_CODE (from) == TEMPLATE_ID_EXPR)
from = TREE_OPERAND (from, 0);
from = BASELINK_FUNCTIONS (from);
if (TREE_CODE (from) == TEMPLATE_ID_EXPR)
from = TREE_OPERAND (from, 0);
- return from;
-}
-
-tree
-get_first_fn (tree from)
-{
- return OVL_CURRENT (get_fns (from));
+ return OVL_CURRENT (from);
}
/* Return a new OVL node, concatenating it with the old one. */
}
/* Return a new OVL node, concatenating it with the old one. */
-/* Similar to `build_nt_call_vec', but for template definitions of
- non-dependent expressions. NON_DEP is the non-dependent expression
- that has been built. */
+/* Similar to `build_call_list', but for template definitions of non-dependent
+ expressions. NON_DEP is the non-dependent expression that has been
+ built. */
tree
build_min_non_dep_call_vec (tree non_dep, tree fn, VEC(tree,gc) *argvec)
tree
build_min_non_dep_call_vec (tree non_dep, tree fn, VEC(tree,gc) *argvec)
{
tree decl, context;
tree binfo;
{
tree decl, context;
tree binfo;
- tree current = current_nonlambda_class_type ();
- if (current
- && (binfo = lookup_base (current, type, ba_any, NULL)))
- context = current;
+ if (current_class_type
+ && (binfo = lookup_base (current_class_type, type,
+ ba_unique | ba_quiet, NULL)))
+ context = current_class_type;
else
{
/* Reference from a nested class member function. */
else
{
/* Reference from a nested class member function. */
&& same_type_p (TYPE_MAIN_VARIANT (TREE_TYPE (current_class_ref)),
current_class_type))
decl = current_class_ref;
&& same_type_p (TYPE_MAIN_VARIANT (TREE_TYPE (current_class_ref)),
current_class_type))
decl = current_class_ref;
- else if (current != current_class_type
- && context == nonlambda_method_basetype ())
- /* In a lambda, need to go through 'this' capture. */
- decl = (cp_build_indirect_ref
- ((lambda_expr_this_capture
- (CLASSTYPE_LAMBDA_EXPR (current_class_type))),
- RO_NULL, tf_warning_or_error));
else
decl = build_dummy_object (context);
else
decl = build_dummy_object (context);
2010-04-27 Jason Merrill <jason@redhat.com>
2010-04-27 Jason Merrill <jason@redhat.com>
+ * g++.dg/cpp0x/lambda/lambda-ice1.C: New.
+
PR c++/41468
* g++.dg/template/sfinae17.C: New.
* g++.dg/template/sfinae18.C: New.
PR c++/41468
* g++.dg/template/sfinae17.C: New.
* g++.dg/template/sfinae18.C: New.