diff options
author | Douglas Gregor <dgregor@apple.com> | 2013-03-26 23:36:30 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2013-03-26 23:36:30 +0000 |
commit | 0162c1ce296fc48fbe03a31a2ae00b939eef86a8 (patch) | |
tree | b2b56e876043541f2a0dbc228e506a8c89c4e82a /test/SemaTemplate/derived.cpp | |
parent | 7020346e4137375d41fc4ac70bfda06e2c724444 (diff) |
<rdar://problem/13267210> Ensure that Sema::CompareReferenceRelationship returns consistent results with invalid types.
When Sema::RequireCompleteType() is given a class template
specialization type that then fails to instantiate, it returns
'true'. On subsequent invocations, it can return false. Make sure that
this difference doesn't change the result of
Sema::CompareReferenceRelationship, which is expected to remain stable
while we're checking an initialization sequence.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178088 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate/derived.cpp')
-rw-r--r-- | test/SemaTemplate/derived.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/SemaTemplate/derived.cpp b/test/SemaTemplate/derived.cpp index 1fb9401c94..7b91f9a3ed 100644 --- a/test/SemaTemplate/derived.cpp +++ b/test/SemaTemplate/derived.cpp @@ -10,3 +10,21 @@ void test() { Foo2(vector2<int*>()); // expected-error{{no matching function for call to 'Foo2'}} Foo(vector<int*>()); // expected-error{{no matching function for call to 'Foo'}} } + +namespace rdar13267210 { + template < typename T > class A { + BaseTy; // expected-error{{C++ requires a type specifier for all declarations}} + }; + + template < typename T, int N > class C: A < T > {}; + + class B { + C<long, 16> ExternalDefinitions; + C<long, 64> &Record; + + void AddSourceLocation(A<long> &R); // expected-note{{passing argument to parameter 'R' here}} + void AddTemplateKWAndArgsInfo() { + AddSourceLocation(Record); // expected-error{{non-const lvalue reference to type}} + } + }; +} |