[Boost-bugs] [Boost C++ Libraries] #12375: Patch fixing use of boost::icl w/ MSVC CL.exe /P

Subject: [Boost-bugs] [Boost C++ Libraries] #12375: Patch fixing use of boost::icl w/ MSVC CL.exe /P
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2016-08-03 10:51:40


#12375: Patch fixing use of boost::icl w/ MSVC CL.exe /P
------------------------------+---------------------
 Reporter: anonymous | Owner: jofaber
     Type: Patches | Status: new
Milestone: To Be Determined | Component: ICL
  Version: Boost 1.61.0 | Severity: Problem
 Keywords: |
------------------------------+---------------------
 This patch makes it possible to use this header in programs built using
 the FASTbuild (http://fastbuild.org) and more precisely its caching
 feature.

 Considering the following code:

 clmacro.cpp:
 {{{
 int main(void)
 {
 #define funny_type(x) x
 funny_type(int)const a = 2; // cl.exe -P clmacro.cpp -> `intconst a`
 }
 }}}

 On MSVC (Visual Studio 2013)
 Microsoft (R) C/C++ Optimizing Compiler Version 18.00.40629 for x86
 Copyright (C) Microsoft Corporation. All rights reserved.

 This compiles correctly by default with `CL.exe`

 {{{
 Cl.exe clmacro.cpp
 }}}

 However when using the `/P` compilation flag to obtain the pre-processed
 source, then trying to compile the resulting file this will fail because
 const gets stitched to the other symbol before compilation.

 See:

 {{{
 cl.exe -P -Ficlmacro.i.cpp clmacro.cpp && cl.exe clmacro.i.cpp
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/12375>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:20 UTC