summaryrefslogtreecommitdiffstats
path: root/test/FixIt/fixit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/FixIt/fixit.cpp')
-rw-r--r--test/FixIt/fixit.cpp33
1 files changed, 32 insertions, 1 deletions
diff --git a/test/FixIt/fixit.cpp b/test/FixIt/fixit.cpp
index fca596b..52bbb38 100644
--- a/test/FixIt/fixit.cpp
+++ b/test/FixIt/fixit.cpp
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -pedantic -Wall -Wno-comment -verify -fcxx-exceptions -x c++ %s
-// RUN: %clang_cc1 -fsyntax-only -fdiagnostics-parseable-fixits -x c++ %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -fsyntax-only -fdiagnostics-parseable-fixits -x c++ %s 2>&1 | FileCheck %s
// RUN: cp %s %t
// RUN: not %clang_cc1 -pedantic -Wall -Wno-comment -fcxx-exceptions -fixit -x c++ %t
// RUN: %clang_cc1 -fsyntax-only -pedantic -Wall -Werror -Wno-comment -fcxx-exceptions -x c++ %t
@@ -307,3 +307,34 @@ namespace dtor_fixit {
// CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:6-[[@LINE-1]]:9}:"foo"
};
}
+
+namespace PR5066 {
+ template<typename T> struct X {};
+ X<int *p> x; // expected-error {{type-id cannot have a name}}
+}
+
+namespace PR5898 {
+ class A {
+ public:
+ const char *str();
+ };
+ const char* foo(A &x)
+ {
+ return x.str.(); // expected-error {{unexpected '.' in function call; perhaps remove the '.'?}}
+ }
+ bool bar(A x, const char *y) {
+ return foo->(x) == y; // expected-error {{unexpected '->' in function call; perhaps remove the '->'?}}
+ }
+}
+
+namespace PR15045 {
+ class Cl0 {
+ public:
+ int a;
+ };
+
+ int f() {
+ Cl0 c;
+ return c->a; // expected-error {{member reference type 'PR15045::Cl0' is not a pointer; maybe you meant to use '.'?}}
+ }
+}
OpenPOWER on IntegriCloud