On 11.09.2013 17:02, Jason Merrill wrote:
On 09/09/2013 10:19 PM, Adam Butcher wrote:
+ if (current_class_type && LAMBDA_TYPE_P (current_class_type))
+ {
+ if (cxx_dialect < cxx1y)
+ pedwarn (location_of (type), 0,
+ "use of %<auto%> in lambda parameter declaration "
+ "only available with "
+ "-std=c++1y or -std=gnu++1y");
+ }
+ else
+ pedwarn (location_of (type), OPT_Wpedantic,
+ "ISO C++ forbids use of %<auto%> in parameter "
+ "declaration");
I think we want to limit the implicit template extension to C++1y
mode as well.
OK. Do you think we should mark 'type' as 'error_mark_node' in the
pre-C++1y cases to reject the user program or just stick to the pedwarn
0?
I.e. this:
if (current_class_type && LAMBDA_TYPE_P (current_class_type))
{
if (cxx_dialect < cxx1y)
{
pedwarn (location_of (type), 0,
"use of %<auto%> in lambda parameter declaration "
"only available with "
"-std=c++1y or -std=gnu++1y");
type = error_mark_node;
}
}
else if (cxx_dialect < cxx1y)
{
pedwarn (location_of (type), 0,
"use of %<auto%> in parameter declaration "
"only available with "
"-std=c++1y or -std=gnu++1y");
type = error_mark_node;
}
else
pedwarn (location_of (type), OPT_Wpedantic,
"ISO C++ forbids use of %<auto%> in parameter "
"declaration");
or the same but without the "type = error_mark_node;" lines?