From a90606ab979762ce4630777c2fce5c921d0a2b96 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Tue, 1 Dec 2020 09:41:16 +0100 Subject: c++, debug: Treat -std=c++20 -gdwarf-5 like C++14 rather than C++98 I have noticed that while we use DW_LANG_C_plus_plus_14 for -std=c++17 -gdwarf-5, we use DW_LANG_C_plus_plus (aka C++98) for -std=c++20 -gdwarf-5. The following patch makes those two match. 2020-12-01 Jakub Jelinek * dwarf2out.c (gen_compile_unit_die): Treat GNU C++20 like C++14 for -gdwarf-5. * g++.dg/debug/dwarf2/lang-cpp17.C: New test. * g++.dg/debug/dwarf2/lang-cpp20.C: New test. --- gcc/dwarf2out.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gcc/dwarf2out.c') diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index bfe2d63..0a0a7ea 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -24646,7 +24646,8 @@ gen_compile_unit_die (const char *filename) language = DW_LANG_C_plus_plus_11; else if (strcmp (language_string, "GNU C++14") == 0) language = DW_LANG_C_plus_plus_14; - else if (strcmp (language_string, "GNU C++17") == 0) + else if (strcmp (language_string, "GNU C++17") == 0 + || strcmp (language_string, "GNU C++20") == 0) /* For now. */ language = DW_LANG_C_plus_plus_14; } -- cgit v1.1