This is an archive of the discontinued LLVM Phabricator instance.

[AST] Fix a crash on mangling a binding decl from a DeclRefExpr.
ClosedPublic

Authored by hokein on Aug 18 2020, 1:43 AM.

Diff Detail

Event Timeline

hokein created this revision.Aug 18 2020, 1:43 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 18 2020, 1:43 AM
hokein requested review of this revision.Aug 18 2020, 1:43 AM
rsmith accepted this revision.Aug 18 2020, 1:39 PM

Here's a testcase that produces a name with external linkage:

struct X { int i, j; };
auto [a,b] = X{1,2};
template<typename T> void f(decltype(a + T())) {}
template void f<int>(int);

We should make sure that we mangle the reference to a as _Z1aE here.

This revision is now accepted and ready to land.Aug 18 2020, 1:39 PM
hokein updated this revision to Diff 286488.Aug 19 2020, 12:03 AM

add one more test.

Here's a testcase that produces a name with external linkage:

struct X { int i, j; };
auto [a,b] = X{1,2};
template<typename T> void f(decltype(a + T())) {}
template void f<int>(int);

We should make sure that we mangle the reference to a as _Z1aE here.

Thanks, added.

This revision was landed with ongoing or failed builds.Aug 19 2020, 12:13 AM
This revision was automatically updated to reflect the committed changes.