llvm-capstone/clang/test/Preprocessor/stringize_skipped.c
Ilya Biryukov b455fc429f [Preprocessor] Always discard body of #define if we failed to parse it
Summary:
Preivously we would only discard it if we failed to parse parameter lists.
If we do not consume the body, parser sees tokens inside directive. In
turn, this leads to spurious diagnostics and a crash in TokenBuffer, see
the added tests.

Reviewers: sammccall

Reviewed By: sammccall

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D65517

llvm-svn: 367530
2019-08-01 09:10:37 +00:00

6 lines
211 B
C

// RUN: %clang_cc1 -fsyntax-only -verify %s
// Ensure we see the error from PP and do not see errors from the parser.
// expected-error@+1{{'#' is not followed by a macro parameter}}
#define INVALID() #B 10+10