if (diagnostic->kind == DK_NOTE && m_inhibit_notes_p)
return false;
- if (m_lock > 0)
- {
- /* If we're reporting an ICE in the middle of some other error,
- try to flush out the previous error, then let this one
- through. Don't do this more than once. */
- if ((diagnostic->kind == DK_ICE || diagnostic->kind == DK_ICE_NOBT)
- && m_lock == 1)
- pp_newline_and_flush (m_reference_printer);
- else
- error_recursion ();
- }
-
/* If the user requested that warnings be treated as errors, so be
it. Note that we do this before the next block so that
individual warnings can be overridden back to warnings with
if (diagnostic->kind != DK_NOTE && diagnostic->kind != DK_ICE)
check_max_errors (false);
+ if (m_lock > 0)
+ {
+ /* If we're reporting an ICE in the middle of some other error,
+ try to flush out the previous error, then let this one
+ through. Don't do this more than once. */
+ if ((diagnostic->kind == DK_ICE || diagnostic->kind == DK_ICE_NOBT)
+ && m_lock == 1)
+ pp_newline_and_flush (m_reference_printer);
+ else
+ error_recursion ();
+ }
+
m_lock++;
if (diagnostic->kind == DK_ICE || diagnostic->kind == DK_ICE_NOBT)
--- /dev/null
+// PR c++/116960
+// { dg-do compile { target c++20 } }
+
+template<auto>
+using Foo = decltype([](auto) { return 0; }(0));
+
+template<typename...>
+Foo<[] {}> foo() {} // { dg-warning "no return statement" }
+
+auto t = foo();
--- /dev/null
+// PR c++/119303
+
+template <class> struct c {
+ enum { d = 4 };
+};
+template <bool> struct e {
+ typedef void g;
+};
+template <class _Tp>
+inline typename e<!c<_Tp>::d>::g bar(_Tp); // { dg-warning "used but never defined" }
+
+int x;
+
+void foo() { bar(x); }