@@ -20925,7 +20925,7 @@ static tree
make_auto_1 (tree name)
{
tree au = cxx_make_type (TEMPLATE_TYPE_PARM);
- TYPE_NAME (au) = build_decl (BUILTINS_LOCATION,
+ TYPE_NAME (au) = build_decl (input_location,
TYPE_DECL, name, au);
TYPE_STUB_DECL (au) = TYPE_NAME (au);
TEMPLATE_TYPE_PARM_INDEX (au) = build_template_parm_index
--
[PATCH] Move 'build_cplus_new' call to after 'start_preparsed_function'
and call 'set_flags_from_callee' prior to prevent ICE due to unexpected
tree type and fix exception handling.
---
@@ -885,13 +885,10 @@ maybe_add_lambda_conv_op (tree type)
}
}
else
- {
call = build_call_a (callop,
direct_argvec->length (),
direct_argvec->address ());
- if (MAYBE_CLASS_TYPE_P (TREE_TYPE (call)))
- call = build_cplus_new (TREE_TYPE (call), call, tf_warning_or_error);
- }
+
CALL_FROM_THUNK_P (call) = 1;
tree stattype = build_function_type (fn_result, FUNCTION_ARG_CHAIN
(callop));
@@ -987,6 +984,12 @@ maybe_add_lambda_conv_op (tree type)
}
tree body = begin_function_body ();
tree compound_stmt = begin_compound_stmt (0);
+ if (!generic_lambda_p)
+ {
+ set_flags_from_callee (call);
+ if (MAYBE_CLASS_TYPE_P (TREE_TYPE (call)))
+ call = build_cplus_new (TREE_TYPE (call), call, tf_warning_or_error);
+ }
call = convert_from_reference (call);
finish_return_stmt (call);
--
[PATCH] Don't allow 'auto' in type of catch parameter.
---
@@ -10328,6 +10328,11 @@ grokdeclarator (const cp_declarator
*declarator,
error ("template parameter declared %<auto%>");
type = error_mark_node;
}
+ else if (decl_context == CATCHPARM)
+ {
+ error ("catch parameter declared %<auto%>");
+ type = error_mark_node;
+ }
else if (current_class_type && LAMBDA_TYPE_P (current_class_type))
{
if (cxx_dialect < cxx1y)
--
[PATCH] cpp0x/auto9.C: Downgrade expected error to expected pedwarn.
---
b/gcc/testsuite/g++.dg/cpp0x/auto9.C
@@ -117,8 +117,8 @@ template <auto V = 4> struct G {}; // { dg-error
"auto" }
template <typename T> struct H { H (); ~H (); };
H<auto> h; // { dg-error "invalid" }
-void qq (auto); // { dg-error "auto" }
-void qr (auto*); // { dg-error "auto" }
+void qq (auto); // { dg-warning "auto" }
+void qr (auto*); // { dg-warning "auto" }
// PR c++/46145