35 lines · c
1// RUN: not %clang_cc1 -fsyntax-only -pedantic-errors %s 2>&1 | FileCheck %s --check-prefix=PRESUMED2// RUN: not %clang_cc1 -fsyntax-only -pedantic-errors -fno-diagnostics-use-presumed-location %s 2>&1 | FileCheck %s --check-prefix=SPELLING3 4#line 1005#define X(y) y6X(int n = error);7 8// PRESUMED: diag-presumed.c:101:11: error: use of undeclared identifier 'error'9// SPELLING: diag-presumed.c:6:11: error: use of undeclared identifier 'error'10 11;12// PRESUMED: diag-presumed.c:106:1: error: extra ';' outside of a functio13// SPELLING: diag-presumed.c:11:1: error: extra ';' outside of a functio14 15# 1 "thing1.cc" 116# 1 "thing1.h" 117# 1 "systemheader.h" 1 318;19// No diagnostic here: we're in a system header, even if we're using spelling20// locations for the diagnostics..21// PRESUMED-NOT: extra ';'22// SPELLING-NOT: extra ';'23 24another error;25// PRESUMED: included from {{.*}}diag-presumed.c:110:26// PRESUMED: from thing1.cc:1:27// PRESUMED: from thing1.h:1:28// PRESUMED: systemheader.h:7:1: error: unknown type name 'another'29 30// SPELLING-NOT: included from31// SPELLING: diag-presumed.c:24:1: error: unknown type name 'another'32 33# 1 "thing1.h" 234# 1 "thing1.cc" 235