[cfe-dev] Invalid mangled names emitted for local types declared in Apple Block expressions used in non-static data member initializers
Tom Honermann via cfe-dev
cfe-dev at lists.llvm.org
Wed Sep 6 14:16:30 PDT 2017
Clang appears to be generating ill-formed mangled names for local types
declared in Apple Block expressions used as non-static data member
initializers:
$ cat t.cpp
template<typename T> void tf(T) {}
struct S {
void(^bp)() = ^{
enum E {} e;
tf(e);
};
};
auto x = S{}.bp;
$ clang++ --version
clang version 4.0.0 (tags/RELEASE_400/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
...
$ clang++ -c -std=c++11 -fblocks t.cpp
$ nm t.o
...
0000000000000000 W _Z2tfIZ1S2bpMUb0_E1EEvT_
...
The mangled name generated for the function template specialization
instantiated for the local enum type 'E' uses a <pointer-to-member-type>
production [1] (as signified by 'M'), but only one of the two required
dependent productions is present (<class type> via 'Ub0_', but not
<member type>).
If someone can confirm that this is not intentional (it could be since
Apple Blocks aren't governed by the Itanium ABI), I'll file a new BZ for
this.
Additionally, for unnamed local types, discriminators are not added to
disambiguate such types. Bug 34511 [2] has been filed for that issue.
Tom.
[1]:
http://itanium-cxx-abi.github.io/cxx-abi/abi.html#mangle.pointer-to-member-type
[2]: https://bugs.llvm.org/show_bug.cgi?id=34511
More information about the cfe-dev
mailing list