Go to file
Richard Smith 0e5d7b8c6b When we perform dependent name lookup during template instantiation, it's not
sufficient to only consider names visible at the point of instantiation,
because that may not include names that were visible when the template was
defined. More generally, if the instantiation backtrace goes through a module
M, then every declaration visible within M should be available to the
instantiation. Any of those declarations might be part of the interface that M
intended to export to a template that it instantiates.

The fix here has two parts:

1) If we find a non-visible declaration during name lookup during template
instantiation, check whether the declaration was visible from the defining
module of all entities on the active template instantiation stack. The defining
module is not the owning module in all cases: we look at the module in which a
template was defined, not the module in which it was first instantiated.

2) Perform pending instantiations at the end of a module, not at the end of the
translation unit. This is general goodness, since it significantly cuts down
the amount of redundant work that is performed in every TU importing a module,
and also implicitly adds the module containing the point of instantiation to
the set of modules checked for declarations in a lookup within a template
instantiation.

There's a known issue here with template instantiations performed while
building a module, if additional imports are added later on. I'll fix that
in a subsequent commit.

llvm-svn: 187167
2013-07-25 23:08:39 +00:00
clang When we perform dependent name lookup during template instantiation, it's not 2013-07-25 23:08:39 +00:00
clang-tools-extra cpp11-migrate: Tweak lit tests to avoid false negatives 2013-07-25 20:20:20 +00:00
compiler-rt [sanitizer] Change strip_path_prefix flag behavior. 2013-07-22 16:14:38 +00:00
debuginfo-tests Now that we get non-trivial value parameters locations correct, un-XFAIL these tests. 2013-06-19 22:07:11 +00:00
libclc Added get_num_groups 2013-07-24 18:03:38 +00:00
libcxx literal suffixes for std::chrono 2013-07-24 21:18:14 +00:00
libcxxabi Updated CREDITS.TXT 2013-07-02 19:01:59 +00:00
lld Add yaml2obj to check-lld deps, since the PECOFF tests need it 2013-07-25 23:05:13 +00:00
lldb tests: Build test code on FreeBSD the same way as on Linux 2013-07-25 21:02:34 +00:00
llvm Add a bool->StringRef c'tor to StringRef. 2013-07-25 23:06:39 +00:00
polly BlockGenerator: Split getNewValue. 2013-07-25 09:12:07 +00:00