[all-commits] [llvm/llvm-project] be6ac4: [ms] Fix Microsoft compatibility handling of comma...

Eric Astor via All-commits all-commits at lists.llvm.org
Mon Nov 4 09:59:24 PST 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: be6ac471f613427f3b5b3a306fe033e526d59f76
      https://github.com/llvm/llvm-project/commit/be6ac471f613427f3b5b3a306fe033e526d59f76
  Author: Eric Astor <epastor at google.com>
  Date:   2019-11-04 (Mon, 04 Nov 2019)

  Changed paths:
    M clang/lib/Lex/PPMacroExpansion.cpp
    M clang/test/Preprocessor/microsoft-ext.c

  Log Message:
  -----------
  [ms] Fix Microsoft compatibility handling of commas in nested macro expansions.

In Microsoft-compatibility mode, single commas from nested macro expansions
should not be considered as argument separators; we already emulated this by
marking them to be ignored. However, in MSVC's preprocessor, subsequent
expansions DO treat these commas as argument separators... so we now ignore
each comma at most once.

Includes a small unit test that validates we match MSVC's behavior as shown
in https://gcc.godbolt.org/z/y0twaq

Fixes PR43282

Subscribers: cfe-commits

Tags: #clang

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




More information about the All-commits mailing list