diff options
author | Richard Trieu <rtrieu@google.com> | 2011-09-20 20:03:50 +0000 |
---|---|---|
committer | Richard Trieu <rtrieu@google.com> | 2011-09-20 20:03:50 +0000 |
commit | c11030ea936f6952deb5a1423ce1648173cd417e (patch) | |
tree | 9b289b2e19db291291d211ad25ad8abe8210ca28 /test/Parser/cxx-casting.cpp | |
parent | bf5851a9f2ba2323b96626bbd78de45c0db1da95 (diff) |
Fix a problem in digraph handling where "[:" might be treated as "<::" and
erronously trigger the digraph correction fix-it. Include a new test to catch
this in the future.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140175 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Parser/cxx-casting.cpp')
-rw-r--r-- | test/Parser/cxx-casting.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/test/Parser/cxx-casting.cpp b/test/Parser/cxx-casting.cpp index cb82c8efda..42ad12ee94 100644 --- a/test/Parser/cxx-casting.cpp +++ b/test/Parser/cxx-casting.cpp @@ -68,7 +68,8 @@ void test2(char x, struct B * b) { (void)static_cast LCC c>(&x); // expected-error{{found '<::' after a static_cast which forms the digraph '<:' (aka '[') and a ':', did you mean '< ::'?}} } -template <class T> class D {}; + // This note comes from "::D[:F> A5;" +template <class T> class D {}; // expected-note{{template is declared here}} template <class T> void E() {}; class F {}; @@ -82,4 +83,10 @@ void test3() { D< ::F> A4; ::E< ::F>(); E< ::F>(); + + // Make sure that parser doesn't expand '[:' to '< ::' + ::D[:F> A5; // expected-error {{cannot refer to class template 'D' without a template argument list}} \ + // expected-error {{expected expression}} \ + // expected-error {{expected ']'}} \ + // expected-note {{to match this '['}} } |