[all-commits] [llvm/llvm-project] bb945f: Reland "[lldb][ObjC][NFC] Fix c++20 gcc compile er...
David Spickett via All-commits
all-commits at lists.llvm.org
Fri Jan 26 06:08:03 PST 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: bb945fcd4a54c2c8f898e2bdc0d65fae841a1909
https://github.com/llvm/llvm-project/commit/bb945fcd4a54c2c8f898e2bdc0d65fae841a1909
Author: David Spickett <david.spickett at linaro.org>
Date: 2024-01-26 (Fri, 26 Jan 2024)
Changed paths:
M lldb/source/Plugins/Language/ObjC/NSArray.cpp
M lldb/source/Plugins/Language/ObjC/NSDictionary.cpp
M lldb/source/Plugins/Language/ObjC/NSSet.cpp
Log Message:
-----------
Reland "[lldb][ObjC][NFC] Fix c++20 gcc compile errors"
clang's -Wdtor name is correct, but the standard may have not
intended that meaning, according to https://bugs.llvm.org/show_bug.cgi?id=46979#c1.
Some of the wording may have changed in 20/23, but we of course
need to support c++17 as well as that's our default.
One workaround would be to explicitly open the namespaces,
then declare the destructor inside that.
Another as shown in the bug report is to repeat the class name, without
the template arguments, before the ::~. For example `Bar::Foo<T>::Foo::~Foo`.
(this extra Foo is the injected class name
https://en.cppreference.com/w/cpp/language/injected-class-name)
I chose to do this because it's the smallest change. It works
with gcc-13 and clang in c++17 and 20 modes (https://godbolt.org/z/fqs4fGE7T).
More information about the All-commits
mailing list