{
int count = errorcount + warningcount;
- timevar_start (TV_MODULE_IMPORT);
+ bool timer_running = timevar_cond_start (TV_MODULE_IMPORT);
/* Make sure lazy loading from a template context behaves as if
from a non-template context. */
function_depth--;
- timevar_stop (TV_MODULE_IMPORT);
+ timevar_cond_stop (TV_MODULE_IMPORT, timer_running);
if (!ok)
fatal_error (input_location,
int count = errorcount + warningcount;
- timevar_start (TV_MODULE_IMPORT);
+ bool timer_running = timevar_cond_start (TV_MODULE_IMPORT);
bool ok = !recursive_lazy ();
if (ok)
{
function_depth--;
}
- timevar_stop (TV_MODULE_IMPORT);
+ timevar_cond_stop (TV_MODULE_IMPORT, timer_running);
if (!ok)
fatal_error (input_location, "failed to load pendings for %<%E%s%E%>",
--- /dev/null
+// PR c++/115165
+// { dg-additional-options "-fmodule-header" }
+// { dg-module-cmi {} }
+
+template <typename> struct A { virtual ~A(); };
+struct B : A<char> {};
+struct C : B { C() {} };
+
+class D { C c; };
+void f(D);
+
+struct X {
+ friend void f(X);
+};
--- /dev/null
+// PR c++/115165
+// { dg-additional-options "-fmodules-ts -ftime-report" }
+// { dg-allow-blank-lines-in-output 1 }
+// { dg-prune-output "Time variable" }
+// { dg-prune-output "\[0-9\]+%" }
+// { dg-prune-output "TOTAL" }
+// { dg-prune-output "checks" }
+
+import "timevar-1_a.H";
+X x;