Add c++2b as a permitted language version (#156)

This commit is contained in:
Chloe 2023-01-11 16:09:19 +00:00 committed by GitHub
commit e751294b96
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 0 deletions

View file

@ -415,6 +415,15 @@ void libclang_compile_config::do_set_flags(cpp_standard standard, compile_flags
}
else
throw std::invalid_argument("c++20 is not yet supported for current version of clang");
case cpp_standard::cpp_2b:
if (libclang_parser::libclang_minor_version() >= 61)
{ // Corresponds to Clang version 12
if (flags & compile_flag::gnu_extensions)
add_flag("-std=gnu++2a");
else
add_flag("-std=c++2a");
break;
}
}
if (flags & compile_flag::ms_compatibility)