summaryrefslogtreecommitdiffstats
path: root/clang/test/Parser/cxx-casting.cpp
diff options
context:
space:
mode:
authorRichard Trieu <rtrieu@google.com>2011-09-19 19:01:00 +0000
committerRichard Trieu <rtrieu@google.com>2011-09-19 19:01:00 +0000
commit01fc00106225e5d5e8a50637bcf8edbfa20a431d (patch)
treedcebed84a90f81be7733ef59fc1ea2ab935364dc /clang/test/Parser/cxx-casting.cpp
parent5a54065c4f1220ef6b1128c6fe59f9c962b32b21 (diff)
downloadbcm5719-llvm-01fc00106225e5d5e8a50637bcf8edbfa20a431d.tar.gz
bcm5719-llvm-01fc00106225e5d5e8a50637bcf8edbfa20a431d.zip
Changes to the name lookup have caused a regression in the digraph fix-it hint.
For instance: template <class T> void E() {}; class F {}; void test() { ::E<::F>(); E<::F>(); } Gives the following error messages: error: found '<::' after a template name which forms the digraph '<:' (aka '[') and a ':', did you mean '< ::'? ::E<::F>(); ^~~ < :: error: expected expression E<::F>(); ^ error: expected ']' note: to match this '[' E<::F>(); This patch adds the digraph fix-it check right before the name lookup, moves the shared checking code to a new function, and adds new tests to catch future regressions. llvm-svn: 140039
Diffstat (limited to 'clang/test/Parser/cxx-casting.cpp')
-rw-r--r--clang/test/Parser/cxx-casting.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/clang/test/Parser/cxx-casting.cpp b/clang/test/Parser/cxx-casting.cpp
index 4a0bb4d1e4e..cb82c8efdad 100644
--- a/clang/test/Parser/cxx-casting.cpp
+++ b/clang/test/Parser/cxx-casting.cpp
@@ -67,3 +67,19 @@ void test2(char x, struct B * b) {
test1::A LCC B> e; // expected-error{{found '<::' after a template name which forms the digraph '<:' (aka '[') and a ':', did you mean '< ::'?}}
(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 {};
+template <class T> void E() {};
+class F {};
+
+void test3() {
+ ::D<::F> A1; // expected-error{{found '<::' after a template name which forms the digraph '<:' (aka '[') and a ':', did you mean '< ::'?}}
+ D<::F> A2; // expected-error{{found '<::' after a template name which forms the digraph '<:' (aka '[') and a ':', did you mean '< ::'?}}
+ ::E<::F>(); // expected-error{{found '<::' after a template name which forms the digraph '<:' (aka '[') and a ':', did you mean '< ::'?}}
+ E<::F>(); // expected-error{{found '<::' after a template name which forms the digraph '<:' (aka '[') and a ':', did you mean '< ::'?}}
+
+ ::D< ::F> A3;
+ D< ::F> A4;
+ ::E< ::F>();
+ E< ::F>();
+}
OpenPOWER on IntegriCloud