diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-02-04 13:35:07 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-02-04 13:35:07 +0000 |
commit | 2f9f89c6938a788a904c3be3ae7a64f4297c90a6 (patch) | |
tree | 76a57860a8743d692cdd54eb26b309434a3ca6aa /test/SemaTemplate/dependent-names.cpp | |
parent | 46ff3034d14aaa92b530e96480741f3d5d458cb8 (diff) |
Improve our handling of the current instantiation for qualified
id-expression, e.g.,
CurrentClass<T>::member
Previously, if CurrentClass<T> was dependent and not complete, we
would treat it as a dependent-scoped declaration reference expression,
even if CurrentClass<T> referred to the current instantiation.
Fixes PR8966 and improves type checking of templates.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124867 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate/dependent-names.cpp')
-rw-r--r-- | test/SemaTemplate/dependent-names.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test/SemaTemplate/dependent-names.cpp b/test/SemaTemplate/dependent-names.cpp index 77961069c5..5776ddca2c 100644 --- a/test/SemaTemplate/dependent-names.cpp +++ b/test/SemaTemplate/dependent-names.cpp @@ -102,3 +102,30 @@ namespace test1 { template struct Derived<int>; // expected-note {{requested here}} } + +namespace PR8966 { + template <class T> + class MyClassCore + { + }; + + template <class T> + class MyClass : public MyClassCore<T> + { + public: + enum { + N + }; + + // static member declaration + static const char* array [N]; + + void f() { + MyClass<T>::InBase = 17; + } + }; + + // static member definition + template <class T> + const char* MyClass<T>::array [MyClass<T>::N] = { "A", "B", "C" }; +} |