summaryrefslogtreecommitdiffstats
path: root/clang/test/Modules/cxx-templates.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* C++ modules: fix a bug where loading a declaration with some name would preventRichard Smith2013-09-091-3/+0
| | | | | | | | | | | | | | | | | name lookup from lazily deserializing the other declarations with the same name, by tracking a bit to indicate whether a name in a DeclContext might have additional external results. This also allows lazier reconciling of the lookup table if a module import adds decls to a pre-existing DC. However, this exposes a pre-existing bug, which causes a regression in test/Modules/decldef.mm: if we have a reference to a declaration, and a later-imported module adds a redeclaration, nothing causes us to load that redeclaration when we use or emit the reference (which can manifest as a reference to an undefined inline function, a use of an incomplete type, and so on). decldef.mm has been extended with an additional testcase which fails with or without this change. llvm-svn: 190293
* When merging redeclaration chains across modules, if a declaration is visibleRichard Smith2013-08-021-0/+4
| | | | | | | | | | | | | | | | | | | in one module but is only declared as a friend in another module, keep it visible in the result of the merge. This is incomplete on two axes: 1) Our handling of local extern declarations is basically broken (we put them in the wrong decl context, and don't find them in redeclaration lookup, unless they've previously been declared), and this results in them making friends visible after a merge. 2) Eventually we'll need to mark that this has happened, and more carefully check whether a declaration should be visible if it was only visible in some of the modules in which it was declared. Fortunately it's rare for the identifier namespace of a declaration to change along its redeclaration chain. llvm-svn: 187639
* Fix assert when instantiating a default argument of a template defined in aRichard Smith2013-08-011-0/+3
| | | | | | module. llvm-svn: 187556
* When we perform dependent name lookup during template instantiation, it's notRichard Smith2013-07-251-5/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Add 'not' to commands that are expected to fail.Rafael Espindola2013-07-041-2/+2
| | | | | | | This is at least good documentation, but also opens the possibility of using pipefail. llvm-svn: 185652
* Fix deserializing of class template partial specializations. Assign sequenceRichard Smith2013-06-251-12/+19
| | | | | | | | | | numbers as we deserialize class template partial specializations. We can't assume that the old sequence numbers will work. The sequence numbers are still deterministic, but are now a lot less predictable for class template partial specializations in modules/PCH. llvm-svn: 184811
* Check for matching template-parameter-lists when merging template declarations.Richard Smith2013-06-241-0/+26
| | | | llvm-svn: 184791
* Avoid adding entries to the DeclContext lookup table multiple times when lazilyRichard Smith2013-06-241-4/+0
| | | | | | | | | | | | | | | | | constructing a lookup table. Previously, buildLookup would add lookup table entries for each item lexically within the DC, and adding the first entry with a given name would trigger the external source to add all its entries with that name. Then buildLookup would carry on and re-add those entries all over again. Instead, follow a simple rule: a declaration from an external source is only ever made visible by the external source. One exception to this: since we don't usually build a lookup table for the TU in C, and we never serialize one, we don't expect the external source to provide lookups in the TU in C, so we build those ones ourselves. llvm-svn: 184696
* Slightly improve cross-module merging for function templates.Richard Smith2013-06-241-0/+41
llvm-svn: 184689
OpenPOWER on IntegriCloud