This avoids warnings when using clang-tidy and some IDEs while
preventing undefined behavior.
No tests should be affected by this change, as the interface for
tcu::Exception is not modified.
Components: Framework
VK-GL-CTS issue: 2872
Change-Id: I616ae2db1d28940251b6dcade2c4b3df7e1dc5f5
Exception (const std::string& message);
virtual ~Exception (void) throw() {}
- const char* getMessage (void) const { return m_message.c_str(); }
+ const char* getMessage (void) const { return m_message.what(); }
private:
- const std::string m_message;
+ // std::runtime_error is used here as an immutable ref-counted string.
+ // This allows the copy constructor in the class to be noexcept.
+ const std::runtime_error m_message;
};
//! Base exception class for test exceptions that affect test result