From: Kaelyn Takata Date: Tue, 20 Jan 2015 20:15:29 +0000 (+0000) Subject: Add the test that was supposed to be included with r223162. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d6235ac8219ee4c40fa5cb2def6c6f65f1aee6a9;p=clang 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 --- 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 '}'}}