1 // Test that template contracts are not reintpreted when the reinterpret
2 // contracts flag is not set, regardless of the current TU's contract
4 // { dg-additional-options "-fmodules-ts -fcontracts -fcontract-role=default:maybe,maybe,ignore" }
7 #include <experimental/contract>
9 // { dg-module-cmi foo }
11 export int violation_count{0};
12 export extern "C++" void handle_contract_violation(const std::experimental::contract_violation &violation)
15 printf("violation_count: %d\n", violation_count);
18 export template<typename T>
21 [[ pre audit %custom: t > 0 ]]
23 printf("%s(%d)\n", __FUNCTION__, t);
27 export int fn_int(int n);