/cp
2016-05-20 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/70572
* decl.c (cp_finish_decl): Check do_auto_deduction return value
and return immediately in case of erroneous code.
/testsuite
2016-05-20 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/70572
* g++.dg/cpp1y/auto-fn31.C: New.
From-SVN: r236522
+2016-05-20 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/70572
+ * decl.c (cp_finish_decl): Check do_auto_deduction return value
+ and return immediately in case of erroneous code.
+
2016-05-19 Marek Polacek <polacek@redhat.com>
PR c++/71075
adc_variable_type);
if (type == error_mark_node)
return;
+ if (TREE_CODE (type) == FUNCTION_TYPE)
+ {
+ error ("initializer for %<decltype(auto) %D%> has function type "
+ "(did you forget the %<()%> ?)", decl);
+ TREE_TYPE (decl) = error_mark_node;
+ return;
+ }
cp_apply_type_quals_to_decl (cp_type_quals (type), decl);
}
+2016-05-20 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/70572
+ * g++.dg/cpp1y/auto-fn31.C: New.
+
2016-05-20 H.J. Lu <hongjiu.lu@intel.com>
PR target/70738
--- /dev/null
+// PR c++/70572
+// { dg-do compile { target c++14 } }
+
+void foo ()
+{
+ decltype (auto) a = foo; // { dg-error "initializer" }
+}