diff options
author | Richard Smith <richard@metafoo.co.uk> | 2020-06-16 16:55:56 -0700 |
---|---|---|
committer | Richard Smith <richard@metafoo.co.uk> | 2020-06-16 19:41:14 -0700 |
commit | 237c2a23b6d4fa953f5ae910dccf492db61bb959 (patch) | |
tree | a3afea207c18a8badf78c368fec10aaa59d1852e /llvm/lib/Support/Unix/Program.inc | |
parent | 1b8125b041e28a315e5c5fe64441a2fb07a2f5ea (diff) | |
download | llvm-237c2a23b6d4fa953f5ae910dccf492db61bb959.zip llvm-237c2a23b6d4fa953f5ae910dccf492db61bb959.tar.gz llvm-237c2a23b6d4fa953f5ae910dccf492db61bb959.tar.bz2 |
DR458: Search template parameter scopes in the right order.
C++ unqualified name lookup searches template parameter scopes
immediately after finishing searching the entity the parameters belong
to. (Eg, for a class template, you search the template parameter scope
after looking in that class template and its base classes and before
looking in the scope containing the class template.) This is complicated
by the fact that scope lookup within a template parameter scope looks in
a different sequence of places prior to reaching the end of the
declarator-id in the template declaration.
We used to approximate the proper lookup rule with a hack in the scope /
decl context walk inside name lookup. Now we instead compute the lookup
parent for each template parameter scope. This gets the right answer and
as a bonus is substantially simpler and more uniform.
In order to get this right, we now make sure to enter a distinct Scope
for each template parameter scope. (The fact that we didn't before was
already a bug, but not really observable most of the time, since
template parameters can't shadow each other.)
Diffstat (limited to 'llvm/lib/Support/Unix/Program.inc')
0 files changed, 0 insertions, 0 deletions