diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-02-25 15:54:31 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-02-25 15:54:31 +0000 |
commit | 5149f37cfc736d03233bf92b5ba7c6e866c6647b (patch) | |
tree | 94c9cde645c5ed237117e347883c43084e3f8c1f /test/SemaCXX/nested-name-spec-locations.cpp | |
parent | 0289b666b5f866bd39a6e1d96e56ba348c7fecf2 (diff) |
Maintain nested-name-specifier source-location information through
instantiation of using declarations (all three forms).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126485 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/nested-name-spec-locations.cpp')
-rw-r--r-- | test/SemaCXX/nested-name-spec-locations.cpp | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/test/SemaCXX/nested-name-spec-locations.cpp b/test/SemaCXX/nested-name-spec-locations.cpp new file mode 100644 index 0000000000..f0f42f754c --- /dev/null +++ b/test/SemaCXX/nested-name-spec-locations.cpp @@ -0,0 +1,42 @@ +// RUN: %clang-cc1 -fsyntax-only -verify %s + +// Note: the formatting in this test case is intentionally funny, with +// nested-name-specifiers stretched out vertically so that we can +// match up diagnostics per-line and still verify that we're getting +// good source-location information. + +namespace outer { + namespace inner { + template<typename T> + struct X0 { + }; + } +} + +template<typename T> +struct add_reference { + typedef T& type; +}; + +namespace outer_alias = outer; + +template<typename T> +struct UnresolvedUsingValueDeclTester { + using outer::inner::X0< + typename add_reference<T>::type + * // expected-error{{declared as a pointer to a reference of type}} + >::value; +}; + +UnresolvedUsingValueDeclTester<int> UnresolvedUsingValueDeclCheck; // expected-note{{in instantiation of template class}} + +template<typename T> +struct UnresolvedUsingTypenameDeclTester { + using outer::inner::X0< + typename add_reference<T>::type + * // expected-error{{declared as a pointer to a reference of type}} + >::value; +}; + +UnresolvedUsingTypenameDeclTester<int> UnresolvedUsingTypenameDeclCheck; // expected-note{{in instantiation of template class}} + |