Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What is the intention of A15-4-4
#1
Hi experts,

A15-4-4 

Quote:Rule A15-4-4 (required, implementation, automated)

A declaration of non-throwing function shall contain noexcept specification.


provides this example (17-10):
Code:
// ...
Code:
void F1(); // Compliant - f1, without noexcept specification, declares to throw
// exceptions implicitly

// ...


The implementation of F1 is not provided.

I would assume that a matching implementation of  F1() would be, e.g. 
Code:
void F1() {
  // something ...
  throw std::runtime_error{"problem"};
}

My questions:
1. Is my implementation of F1 above correct?
2. What should a compliant static analysis tool report, when F1 does not throw?
3. Shall a compliant AUTOSAR C++ checker tool here report a violation (error/warning/...) or is this kind of a hint or note? 
4. What shall be reported for the operator()() of a lambda that does not throw and does not explicitly add noexcept (example: auto l = []() { return 42; })?
5. (Bonus question) will a similar check be added to the next version of MISRA C++?
Reply


Messages In This Thread
What is the intention of A15-4-4 - by kth - 23-06-2022, 02:22 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)