How to test static_assert?
summary
Problem: reliably verify compile time static_assert behavior across compilers. Solution builds on SQL++11/17: wrap static_assert into types and split condition from an unconditional failure type that explodes when touched, then test return type via decltype/is_same instead of forcing compilation failures. Uses Clang/GCC/MSVC diagnostic tools for occasional end-to-end checks but notes they are brittle and compiler/version dependent; C++17 if constexpr simplifies and consolidates the approach. Implementation exists in the SQL++ codebase and mostly works though a Clang constexpr instantiation quirk breaks some cases.
AI-written summary · about
chapters (6)
- 0:00Start
- 5:10Basic Approaches
- 11:01Multiple Test Cases in One File
- 14:10Return Types
- 39:09Summary
- 39:24Clean Up








