From d6235ac8219ee4c40fa5cb2def6c6f65f1aee6a9 Mon Sep 17 00:00:00 2001 From: Kaelyn Takata Date: Tue, 20 Jan 2015 20:15:29 +0000 Subject: [PATCH] Add the test that was supposed to be included with r223162. The test case is based on the reduction from PR21679 and has to be freestanding to work correctly, since some of the expected errors (and some of the problems that were fixed) only occur when the end of the file is reached. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@226603 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/SemaCXX/PR21679.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 test/SemaCXX/PR21679.cpp diff --git a/test/SemaCXX/PR21679.cpp b/test/SemaCXX/PR21679.cpp new file mode 100644 index 0000000000..06db2bffdf --- /dev/null +++ b/test/SemaCXX/PR21679.cpp @@ -0,0 +1,13 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s + +int w = z.; // expected-error {{use of undeclared identifier 'z'}} \ + // expected-error {{expected unqualified-id}} + +int x = { y[ // expected-error {{use of undeclared identifier 'y'}} \ + // expected-note {{to match this '['}} \ + // expected-note {{to match this '{'}} \ + // expected-error {{expected ';' after top level declarator}} + +// The errors below all occur on the last line of the file, so splitting them +// among multiple lines doesn't work. +// expected-error {{expected expression}} expected-error {{expected ']'}} expected-error {{expected '}'}} -- 2.50.1