the input: token-pasting was producing a tok::eof.
Patch by Andy Gibbs!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158412
91177308-0d34-0410-b5e6-
96231b3b80d8
<< Buffer.str();
}
- // Do not consume the RHS.
- --CurToken;
+ // An error has occurred so exit loop.
+ break;
}
// Turn ## into 'unknown' to avoid # ## # from looking like a paste
#define COMM / ## *
COMM // expected-error {{pasting formed '/*', an invalid preprocessing token}}
+// Demonstrate that an invalid preprocessing token
+// doesn't swallow the rest of the file...
+#error EOF // expected-error {{EOF}}
--- /dev/null
+// RUN: %clang_cc1 -fms-extensions -Wno-invalid-token-paste %s -verify
+// RUN: %clang_cc1 -E -fms-extensions -Wno-invalid-token-paste %s | FileCheck %s
+// RUN: %clang_cc1 -E -fms-extensions -Wno-invalid-token-paste -x assembler-with-cpp %s | FileCheck %s
+
+#define foo a ## b ## = 0
+int foo;
+// CHECK: int ab = 0;