// Do not emit the warning when preprocessing assembler code.
if (!PP.getLangOptions().AsmPreprocessor)
PP.Diag(PasteOpLoc, diag::err_pp_bad_paste)
- << std::string(Buffer.begin(), Buffer.end()-1);
+ << std::string(Buffer.begin(), Buffer.end());
// Do not consume the RHS.
--CurToken;
// RUN: clang-cc -Eonly -verify -pedantic %s
// pasting ""x"" and ""+"" does not give a valid preprocessing token
-#define XYZ x ## + // expected-error {{pasting formed 'x', an invalid preprocessing token}}
+#define XYZ x ## + // expected-error {{pasting formed 'x+', an invalid preprocessing token}}
XYZ
+#define XXYZ . ## test // expected-error {{pasting formed '.test', an invalid preprocessing token}}
+XXYZ
// GCC PR 20077