From a0fb00f9837bd0d2e5948f16f6a6b82a7a628f51 Mon Sep 17 00:00:00 2001 From: dim Date: Sat, 26 Feb 2011 22:09:03 +0000 Subject: Vendor import of clang trunk r126547: http://llvm.org/svn/llvm-project/cfe/trunk@126547 --- test/SemaCXX/nested-name-spec-locations.cpp | 70 +++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 test/SemaCXX/nested-name-spec-locations.cpp (limited to 'test/SemaCXX/nested-name-spec-locations.cpp') diff --git a/test/SemaCXX/nested-name-spec-locations.cpp b/test/SemaCXX/nested-name-spec-locations.cpp new file mode 100644 index 0000000..25914df --- /dev/null +++ b/test/SemaCXX/nested-name-spec-locations.cpp @@ -0,0 +1,70 @@ +// 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 + struct X0 { + }; + } +} + +template +struct add_reference { + typedef T& type; +}; + +namespace outer_alias = outer; + +template +struct UnresolvedUsingValueDeclTester { + using outer::inner::X0< + typename add_reference::type + * // expected-error{{declared as a pointer to a reference of type}} + >::value; +}; + +UnresolvedUsingValueDeclTester UnresolvedUsingValueDeclCheck; // expected-note{{in instantiation of template class}} + +template +struct UnresolvedUsingTypenameDeclTester { + using outer::inner::X0< + typename add_reference::type + * // expected-error{{declared as a pointer to a reference of type}} + >::value; +}; + +UnresolvedUsingTypenameDeclTester UnresolvedUsingTypenameDeclCheck; // expected-note{{in instantiation of template class}} + + +template +struct PseudoDestructorExprTester { + void f(T *t) { + t->T::template Inner::type + * // expected-error{{as a pointer to a reference of type}} + >::Blarg::~Blarg(); + } +}; + +struct HasInnerTemplate { + template + struct Inner; + + typedef HasInnerTemplate T; +}; + +void PseudoDestructorExprCheck( + PseudoDestructorExprTester tester) { + tester.f(0); // expected-note{{in instantiation of member function}} +} + +template +struct DependentScopedDeclRefExpr { + void f() { + outer_alias::inner::X0::value = 17; + } +}; -- cgit v1.1