µVision export: Handle more C++ language standards

µVision 5.28a now has options for gnu++14, c++14 and c++17, so we can
use them rather than falling back to c++14 or gnu++11.

This does mean that an export of current master, which uses gnu++14,
will now require version 5.28a. I have not tested what happens if
5.27 is given a project file with these new option numbers.

However, export of current master is broken for 5.27 anyway, as the
fallback to gnu++11 means it fails to compile the C++14 constructs
now in the codebase.

Fixes #11217, as long as users update µVision too.
pull/11225/head
Kevin Bracey 2019-08-14 17:13:03 +03:00
parent f8dc035ae4
commit c3a71eb23b
1 changed files with 3 additions and 3 deletions

View File

@ -309,10 +309,10 @@ class Uvision(Exporter):
std = None
cpp_std = {
'c++98': 1, 'gnu++98': 2,
'c++03': 5, 'gnu++03': 2, # UVision 5.27.1.0 does not support gnu++03 - fall back to gnu++98
'c++03': 5, 'gnu++03': 2, # UVision 5.28 does not support gnu++03 - fall back to gnu++98
'c++11': 3, 'gnu++11': 4,
'c++14': 6, 'gnu++14': 4, # UVision 5.27.1.0 does not support gnu++14 - should be able to get it as compiler default, but that doesn't work as documented and requests gnu++98. So fall back to gnu++11
'c++17': 6, 'gnu++17': 4, # UVision 5.27.1.0 does not support c++17/gnu++17 - fall back to c++14/gnu++11
'c++14': 6, 'gnu++14': 7, # UVision 5.28 or later is required for gnu++14, c++14 or gnu++17
'c++17': 8, 'gnu++17': 9,
}
ctx['v6_lang_p'] = cpp_std.get(std, 0)