2011-02-26 03:09:01 +08:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
2011-02-25 23:54:31 +08:00
|
|
|
|
|
|
|
// 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}}
|
|
|
|
|
2011-02-26 02:19:59 +08:00
|
|
|
|
|
|
|
template<typename T, typename U>
|
|
|
|
struct PseudoDestructorExprTester {
|
|
|
|
void f(T *t) {
|
|
|
|
t->T::template Inner<typename add_reference<U>::type
|
|
|
|
* // expected-error{{as a pointer to a reference of type}}
|
|
|
|
>::Blarg::~Blarg();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
struct HasInnerTemplate {
|
|
|
|
template<typename T>
|
|
|
|
struct Inner;
|
|
|
|
|
|
|
|
typedef HasInnerTemplate T;
|
|
|
|
};
|
|
|
|
|
|
|
|
void PseudoDestructorExprCheck(
|
|
|
|
PseudoDestructorExprTester<HasInnerTemplate, float> tester) {
|
|
|
|
tester.f(0); // expected-note{{in instantiation of member function}}
|
|
|
|
}
|