summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2016-08-02 21:29:54 +0000
committerHans Wennborg <hans@hanshq.net>2016-08-02 21:29:54 +0000
commit3b73ffac67c03439a0d63e3f20e72e0e2a953890 (patch)
tree262a150b5f5a17fc45861db0825cd1312a3d2ed3 /test
parentbabe2818c4c2a95af31af2b5856fc11dbca6bc1d (diff)
Merging r277095:
------------------------------------------------------------------------ r277095 | epilk | 2016-07-28 17:55:40 -0700 (Thu, 28 Jul 2016) | 5 lines [Parser] Fix bug where delayed typo in conditional expression was corrected twice Patch by David Tarditi! Differential revision: https://reviews.llvm.org/D22930 ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_39@277525 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/Sema/typo-correction.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/Sema/typo-correction.c b/test/Sema/typo-correction.c
index a1107a25ee..59f022dfe5 100644
--- a/test/Sema/typo-correction.c
+++ b/test/Sema/typo-correction.c
@@ -65,3 +65,18 @@ int fn_with_rs(int r) { r = TYPO + r * TYPO; } // expected-error 2 {{use of unde
void fn_with_unknown(int a, int b) {
fn_with_unknown(unknown, unknown | unknown); // expected-error 3 {{use of undeclared identifier}}
}
+
+// Two typos in a parenthesized expression or argument list with a conditional
+// expression caused a crash in C mode.
+//
+// r272587 fixed a similar bug for binary operations. The same fix was needed for
+// conditional expressions.
+
+int g(int x, int y) {
+ return x + y;
+}
+
+int h() {
+ g(x, 5 ? z : 0); // expected-error 2 {{use of undeclared identifier}}
+ (x, 5 ? z : 0); // expected-error 2 {{use of undeclared identifier}}
+}