diff options
| author | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2016-02-05 19:36:39 +0000 |
|---|---|---|
| committer | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2016-02-05 19:36:39 +0000 |
| commit | fb9b6cd24b26a3e57b627be06415adf3a881435f (patch) | |
| tree | e904e5435ebccdeb8cb8db3b482d7ff3bec2b1ef /clang/test | |
| parent | 98762d242967ff0bec8a47443212eed8a4c4c553 (diff) | |
| download | bcm5719-llvm-fb9b6cd24b26a3e57b627be06415adf3a881435f.tar.gz bcm5719-llvm-fb9b6cd24b26a3e57b627be06415adf3a881435f.zip | |
[Parser] Perform CachedTokens update dependent on token consumption
In the context where we break one tok::greatergreater into two
tok::greater in order to correctly update the cached tokens; update the
CachedTokens with two tok::greater only if ParseGreaterThanInTemplateList
clients asks to consume the last token. Otherwise we only need to add
one because the second is already added later on, as a not yet cached token.
Differential Revision: http://reviews.llvm.org/D16906
rdar://problem/24488367
llvm-svn: 259910
Diffstat (limited to 'clang/test')
| -rw-r--r-- | clang/test/Parser/objcxx14-protocol-in-template.mm | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/clang/test/Parser/objcxx14-protocol-in-template.mm b/clang/test/Parser/objcxx14-protocol-in-template.mm new file mode 100644 index 00000000000..36da92e251f --- /dev/null +++ b/clang/test/Parser/objcxx14-protocol-in-template.mm @@ -0,0 +1,15 @@ +// RUN: %clang_cc1 -fsyntax-only -verify -std=c++14 %s + +template<class T> class vector {}; +@protocol P @end + +// expected-no-diagnostics + +template <typename Functor> void F(Functor functor) {} + +// Test protocol in template within lambda capture initializer context. +void z() { + id<P> x = 0; + (void)x; + F( [ x = vector<id<P>>{} ] {} ); +} |

