c++, debug: Treat -std=c++20 -gdwarf-5 like C++14 rather than C++98
authorJakub Jelinek <jakub@redhat.com>
Tue, 1 Dec 2020 08:41:16 +0000 (09:41 +0100)
committerJakub Jelinek <jakub@redhat.com>
Tue, 1 Dec 2020 08:41:16 +0000 (09:41 +0100)
commita90606ab979762ce4630777c2fce5c921d0a2b96
treef2253e5c4373b240d056f2c7084d9877505ecb73
parent934a54180541d27139aecbd19e7f50cb73552c7c
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  <jakub@redhat.com>

* 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
gcc/testsuite/g++.dg/debug/dwarf2/lang-cpp17.C [new file with mode: 0644]
gcc/testsuite/g++.dg/debug/dwarf2/lang-cpp20.C [new file with mode: 0644]