diff options
| author | John McCall <rjmccall@apple.com> | 2009-12-19 00:35:18 +0000 |
|---|---|---|
| committer | John McCall <rjmccall@apple.com> | 2009-12-19 00:35:18 +0000 |
| commit | e2ade289be7504add6e9855536cb65782b1b3f4b (patch) | |
| tree | 888ed85e0be50813ee62f5e23a1b186ee227a3ce /clang/test | |
| parent | 357e8c94d66735d42f55f8eb9d8a3fd1466ada9f (diff) | |
| download | bcm5719-llvm-e2ade289be7504add6e9855536cb65782b1b3f4b.tar.gz bcm5719-llvm-e2ade289be7504add6e9855536cb65782b1b3f4b.zip | |
Teach TryAnnotateTypeOrScopeToken to deal with already-annotated
scope specifiers. Fix a tentative parsing bug that came up in LLVM.
Incidentally fixes some random FIXMEs in an existing testcase.
llvm-svn: 91734
Diffstat (limited to 'clang/test')
| -rw-r--r-- | clang/test/Parser/cxx-ambig-paren-expr.cpp | 40 | ||||
| -rw-r--r-- | clang/test/SemaTemplate/metafun-apply.cpp | 6 |
2 files changed, 42 insertions, 4 deletions
diff --git a/clang/test/Parser/cxx-ambig-paren-expr.cpp b/clang/test/Parser/cxx-ambig-paren-expr.cpp index 31633a58d7b..39882056723 100644 --- a/clang/test/Parser/cxx-ambig-paren-expr.cpp +++ b/clang/test/Parser/cxx-ambig-paren-expr.cpp @@ -24,3 +24,43 @@ void f() { // FIXME: Special case: "++" is postfix here, not prefix // (S())++; } + +// Make sure we do tentative parsing correctly in conditions. +typedef int type; +struct rec { rec(int); }; + +namespace ns { + typedef int type; + struct rec { rec(int); }; +} + +struct cls { + typedef int type; + struct rec { rec(int); }; +}; + +struct result { + template <class T> result(T); + bool check(); +}; + +void test(int i) { + if (result((cls::type) i).check()) + return; + + if (result((ns::type) i).check()) + return; + + if (result((::type) i).check()) + return; + + if (result((cls::rec) i).check()) + return; + + if (result((ns::rec) i).check()) + return; + + if (result((::rec) i).check()) + return; +} + diff --git a/clang/test/SemaTemplate/metafun-apply.cpp b/clang/test/SemaTemplate/metafun-apply.cpp index 4044d14a84e..bb3c88ad395 100644 --- a/clang/test/SemaTemplate/metafun-apply.cpp +++ b/clang/test/SemaTemplate/metafun-apply.cpp @@ -32,11 +32,9 @@ apply1<add_reference, int>::type ir = i; apply1<add_reference, float>::type fr = i; // expected-error{{non-const lvalue reference to type 'float' cannot bind to a value of unrelated type 'int'}} void test() { - apply1<add_reference, void>::type t; // expected-note{{in instantiation of template class 'struct apply1<struct add_reference, void>' requested here}} \ - // FIXME: expected-error{{unexpected type name 'type': expected expression}} + apply1<add_reference, void>::type t; // expected-note{{in instantiation of template class 'struct apply1<struct add_reference, void>' requested here}} - apply1<bogus, int>::type t2; // expected-note{{in instantiation of template class 'struct apply1<struct bogus, int>' requested here}} \ - // FIXME: expected-error{{unexpected type name 'type': expected expression}} + apply1<bogus, int>::type t2; // expected-note{{in instantiation of template class 'struct apply1<struct bogus, int>' requested here}} } |

