aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.8/gcc/cp/error.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.8/gcc/cp/error.c')
-rw-r--r--gcc-4.8/gcc/cp/error.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/gcc-4.8/gcc/cp/error.c b/gcc-4.8/gcc/cp/error.c
index c2bf54d..35ea0df 100644
--- a/gcc-4.8/gcc/cp/error.c
+++ b/gcc-4.8/gcc/cp/error.c
@@ -78,6 +78,7 @@ static void dump_aggr_init_expr_args (tree, int, bool);
static void dump_expr_list (tree, int);
static void dump_global_iord (tree);
static void dump_parameters (tree, int);
+static void dump_ref_qualifier (tree, int);
static void dump_exception_spec (tree, int);
static void dump_template_argument (tree, int);
static void dump_template_argument_list (tree, int);
@@ -832,6 +833,7 @@ dump_type_suffix (tree t, int flags)
pp_cxx_cv_qualifier_seq (cxx_pp, class_of_this_parm (t));
else
pp_cxx_cv_qualifier_seq (cxx_pp, t);
+ dump_ref_qualifier (t, flags);
dump_exception_spec (TYPE_RAISES_EXCEPTIONS (t), flags);
dump_type_suffix (TREE_TYPE (t), flags);
break;
@@ -1426,6 +1428,7 @@ dump_function_decl (tree t, int flags)
{
pp_base (cxx_pp)->padding = pp_before;
pp_cxx_cv_qualifier_seq (cxx_pp, class_of_this_parm (fntype));
+ dump_ref_qualifier (fntype, flags);
}
if (flags & TFF_EXCEPTION_SPECIFICATION)
@@ -1507,6 +1510,21 @@ dump_parameters (tree parmtypes, int flags)
pp_cxx_right_paren (cxx_pp);
}
+/* Print ref-qualifier of a FUNCTION_TYPE or METHOD_TYPE. FLAGS are ignored. */
+
+static void
+dump_ref_qualifier (tree t, int flags ATTRIBUTE_UNUSED)
+{
+ if (FUNCTION_REF_QUALIFIED (t))
+ {
+ pp_base (cxx_pp)->padding = pp_before;
+ if (FUNCTION_RVALUE_QUALIFIED (t))
+ pp_cxx_ws_string (cxx_pp, "&&");
+ else
+ pp_cxx_ws_string (cxx_pp, "&");
+ }
+}
+
/* Print an exception specification. T is the exception specification. */
static void
@@ -3348,7 +3366,7 @@ maybe_warn_cpp0x (cpp0x_warn_str str)
break;
case CPP0X_AUTO:
pedwarn (input_location, 0,
- "C++0x auto only available with -std=c++11 or -std=gnu++11");
+ "C++11 auto only available with -std=c++11 or -std=gnu++11");
break;
case CPP0X_SCOPED_ENUMS:
pedwarn (input_location, 0,
@@ -3394,6 +3412,11 @@ maybe_warn_cpp0x (cpp0x_warn_str str)
"c++11 attributes "
"only available with -std=c++11 or -std=gnu++11");
break;
+ case CPP0X_REF_QUALIFIER:
+ pedwarn (input_location, 0,
+ "ref-qualifiers "
+ "only available with -std=c++11 or -std=gnu++11");
+ break;
default:
gcc_unreachable ();
}