summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaTemplate/class-template-spec.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-02-25 19:37:18 +0000
committerDouglas Gregor <dgregor@apple.com>2009-02-25 19:37:18 +0000
commit7f74112756f6cada66df1237b86788e71401bae5 (patch)
tree2c7296f80da41208e16e683772df61b8d7ab6837 /clang/test/SemaTemplate/class-template-spec.cpp
parent22a87f94a9259c9295dc22d3d7e4b6c54e242f19 (diff)
downloadbcm5719-llvm-7f74112756f6cada66df1237b86788e71401bae5.tar.gz
bcm5719-llvm-7f74112756f6cada66df1237b86788e71401bae5.zip
Implement parsing of nested-name-specifiers that involve template-ids, e.g.,
std::vector<int>::allocator_type When we parse a template-id that names a type, it will become either a template-id annotation (which is a parsed representation of a template-id that has not yet been through semantic analysis) or a typename annotation (where semantic analysis has resolved the template-id to an actual type), depending on the context. We only produce a type in contexts where we know that we only need type information, e.g., in a type specifier. Otherwise, we create a template-id annotation that can later be "upgraded" by transforming it into a typename annotation when the parser needs a type. This occurs, for example, when we've parsed "std::vector<int>" above and then see the '::' after it. However, it means that when writing something like this: template<> class Outer::Inner<int> { ... }; We have two tokens to represent Outer::Inner<int>: one token for the nested name specifier Outer::, and one template-id annotation token for Inner<int>, which will be passed to semantic analysis to define the class template specialization. Most of the churn in the template tests in this patch come from an improvement in our error recovery from ill-formed template-ids. llvm-svn: 65467
Diffstat (limited to 'clang/test/SemaTemplate/class-template-spec.cpp')
-rw-r--r--clang/test/SemaTemplate/class-template-spec.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/test/SemaTemplate/class-template-spec.cpp b/clang/test/SemaTemplate/class-template-spec.cpp
index 9347bf5997f..86cd52c3e36 100644
--- a/clang/test/SemaTemplate/class-template-spec.cpp
+++ b/clang/test/SemaTemplate/class-template-spec.cpp
@@ -40,3 +40,5 @@ void testme(X<int_type> *x1, X<float, int> *x2) {
x1->foo(); // okay: refers to #1
x2->bar(); // okay: refers to #2
}
+
+// FIXME: diagnose specializations in a different namespace
OpenPOWER on IntegriCloud