C++26 contracts implementation requires modifications to source_location header file. The logic is added but not triggered due to not defining __glibcxx_want_contracts before including the internal version header. This patch fixes this.
libstdc++-v3/ChangeLog: * include/std/source_location: Define __glibcxx_want_contracts. Signed-off-by: Xie Han <[email protected]> --- libstdc++-v3/include/std/source_location | 1 + 1 file changed, 1 insertion(+) diff --git a/libstdc++-v3/include/std/source_location b/libstdc++-v3/include/std/source_location index 170753fdde2..08d9779fa1d 100644 --- a/libstdc++-v3/include/std/source_location +++ b/libstdc++-v3/include/std/source_location @@ -30,6 +30,7 @@ #define _GLIBCXX_SRCLOC 1 #define __glibcxx_want_source_location +#define __glibcxx_want_contracts #include <bits/version.h> #if __cpp_lib_source_location // C++ >= 20 && builtin_source_location -- 2.52.0
