This is an archive of the discontinued LLVM Phabricator instance.

[CXX] Templates specialization visibility can be wrong
ClosedPublic

Authored by steven_wu on Mar 19 2018, 7:06 PM.

Details

Summary

Under some conditions, LinkageComputer can get the visibility for
ClassTemplateSpecializationDecl wrong because it failed to find the Decl
that has the explicit visibility.

This fixes:
llvm.org/bugs/pr36810
rdar://problem/38080953

Diff Detail

Repository
rL LLVM

Event Timeline

steven_wu created this revision.Mar 19 2018, 7:06 PM
doug.gregor added inline comments.
lib/AST/Decl.cpp
1078 ↗(On Diff #139069)

Do we want to look at *all* redeclarations, or only those declarations that precede the declaration that we found? The latter seems more correct, but IIRC visibility has often been able to "look forward" to declarations that come later in the translation unit.

Address review feedback

steven_wu added inline comments.Apr 18 2018, 10:30 AM
lib/AST/Decl.cpp
1078 ↗(On Diff #139069)

I agree the latter is more correct. Update the patch.

doug.gregor accepted this revision.Apr 18 2018, 10:24 PM

LGTM, thanks

This revision is now accepted and ready to land.Apr 18 2018, 10:24 PM
This revision was automatically updated to reflect the committed changes.
This revision was automatically updated to reflect the committed changes.