[boost] [clang] clang-cl expansion of macros

660 views
Skip to first unread message

Edward Diener

unread,
Apr 15, 2016, 6:15:46 PM4/15/16
to bo...@lists.boost.org
You can get clang-cl ( clang-win ) to show its VC++ emulated expansion
of macros somewhat by passing the c++ option
'-fmacro-backtrace-limit=0' to the compiler. It is still blessedly
difficult to see the what and the why of clang's error messages when
expanding macro using clang-cl, but at least it gives you a better
chance of understanding where clang's emulation of VC++ has gone wrong.

I have posted bug 27380 to the llvm/clang bug tracker at
https://llvm.org/bugs/show_bug.cgi?id=27380 showing the main failure in
VC++ emulation which I see when testing Boost PP with clang-cl.


_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

degski

unread,
Apr 16, 2016, 12:58:58 AM4/16/16
to boost
On 16 April 2016 at 01:15, Edward Diener <eldi...@tropicsoft.com> wrote:

I have posted bug 27380 to the llvm/clang bug tracker...
>

Thanks for not giving up (also @ Niall D.)!

Edward Diener

unread,
Apr 16, 2016, 10:59:21 AM4/16/16
to bo...@lists.boost.org
On 4/16/2016 12:58 AM, degski wrote:
> On 16 April 2016 at 01:15, Edward Diener <eldi...@tropicsoft.com> wrote:
>
> I have posted bug 27380 to the llvm/clang bug tracker...
>>
>
> Thanks for not giving up (also @ Niall D.)!

There's more. See bug 27382 at
https://llvm.org/bugs/show_bug.cgi?id=27382. And there is almost
certainly more if the further errors from running the Boost PP tests are
indicating other separate bugs. But I won't pursue further bug reports
along those lines until I can ascertain whether or not fixing the ones
that I have reported causes the remaining ones that appear when running
the Boost PP tests to go away or not. And I haven't even started on
clang-cl preprocessor bugs which the tests of VMD might reveal !

As I suspected the task of emulating the non-standard preprocessor
behavior of VC++ is a daunting task and largely a fool's errand. If
clang targeting VC++ had limited themselves to using their VC++
preprocessor emulation only for Windows headers and VC++ headers, while
allowing all other header files to use their normal C++ standard
conforming preprocessor, they would not have had to solve the emulation
problem for all preprocessor macros. But they would not listen to reason
concerning this.

What I strongly suspect will finally happen is that clang will not fix
these emulation problems because they are too tricky and numerous to do.
Instead they will probably declare that their emulation is good enough
for the majority of preprocessor constructs and that Boost PP, which
pushes the preprocessor to its limits, is not meant to work with their
flawed VC++ emulation. I hope I am wrong about that supposition, but
having spent much time in Boost PP and Boost VMD trying to workaround
VC++ non-standard preprocessor behavior I can envision that having to
code "down" to that behavior in numerous complicated instances will be
too much time consuming work for the clang developers who have chosen to
work with VC++ preprocessor emulation.

Niall Douglas

unread,
Apr 17, 2016, 7:05:38 AM4/17/16
to bo...@lists.boost.org
On 16 Apr 2016 at 7:58, degski wrote:

> On 16 April 2016 at 01:15, Edward Diener <eldi...@tropicsoft.com> wrote:
>
> I have posted bug 27380 to the llvm/clang bug tracker...
> >
>
> Thanks for not giving up (also @ Niall D.)!

Thanks for saying so, but we could do a lot better.

I flicked through the clang source code and as far as I can tell from
a ten minute inspection, getting C99 preprocessor behaviour on MSVC
ABI targets is as easy as flipping a boolean on. Most of the other
MSVC preprocessor special behaviours only turn on with
-fms-compatibility=on, and we no longer need that turned on to use
Windows or indeed the MSVC CRT and STL. A source code patch ought to
be mostly figuring out how to add a command line argument to control
the C99 processor boolean, a few unit test cases to ensure rigour and
lack of regression, and that's about it.

The real effort behind such a patch would be navigating the internal
politics on getting the patch into trunk. I have no need in my own
code for a C99 preprocessor, hence I am not willing to invest that
effort. But others with a more pressing need may wish to do so.

Niall

--
ned Productions Limited Consulting
http://www.nedproductions.biz/
http://ie.linkedin.com/in/nialldouglas/


Edward Diener

unread,
Apr 17, 2016, 8:13:37 AM4/17/16
to bo...@lists.boost.org
Why not bring up the issue on the clang developers mailing list ? Clang
source code is not an area which Boost developers can affect in this
mailing list, but in the clang developers mailing list you might be able
to persuade a clang developer to listen to your suggestion(s).

Niall Douglas

unread,
Apr 17, 2016, 11:48:33 AM4/17/16
to bo...@lists.boost.org
On 17 Apr 2016 at 8:13, Edward Diener wrote:

> > The real effort behind such a patch would be navigating the internal
> > politics on getting the patch into trunk. I have no need in my own
> > code for a C99 preprocessor, hence I am not willing to invest that
> > effort. But others with a more pressing need may wish to do so.
>
> Why not bring up the issue on the clang developers mailing list ? Clang
> source code is not an area which Boost developers can affect in this
> mailing list, but in the clang developers mailing list you might be able
> to persuade a clang developer to listen to your suggestion(s).

That would be the "navigating the internal politics" I mentioned. I
have no current pressing need for a C99 conforming preprocessor in my
own code.

Edward Diener

unread,
Apr 17, 2016, 2:35:40 PM4/17/16
to bo...@lists.boost.org
On 4/17/2016 11:41 AM, Niall Douglas wrote:
> On 17 Apr 2016 at 8:13, Edward Diener wrote:
>
>>> The real effort behind such a patch would be navigating the internal
>>> politics on getting the patch into trunk. I have no need in my own
>>> code for a C99 preprocessor, hence I am not willing to invest that
>>> effort. But others with a more pressing need may wish to do so.
>>
>> Why not bring up the issue on the clang developers mailing list ? Clang
>> source code is not an area which Boost developers can affect in this
>> mailing list, but in the clang developers mailing list you might be able
>> to persuade a clang developer to listen to your suggestion(s).
>
> That would be the "navigating the internal politics" I mentioned. I
> have no current pressing need for a C99 conforming preprocessor in my
> own code.

Nor do I as far as clang goes, since normal clang and clang targeting
mingw(-64)/gcc on Windows already has a C++ standard conformant
preprocessor already and works very well with Boost libraries.

I guess it must be those people who want to use clang targeting VC++ on
Windows, either by itself or with the VC++14 as the backend compiler,
who might want what you suggest. But since I know that isn't you from
your response and it is certainly not me, someone else can address the
issue of convincing clang to change their source, and "navigate the
internal politics" if they like.

degski

unread,
Apr 18, 2016, 1:02:27 AM4/18/16
to boost
On 17 April 2016 at 21:35, Edward Diener <eldi...@tropicsoft.com> wrote:

... clang targeting mingw(-64)/gcc on Windows ...
>

msys/mingw(-64)/gcc is not, in my experience, a good all-round solution...
it's a work-around (a kludge) and comes with compromises (like wine on
Linux)... the emulation is not complete (sounds familiar)... I only use one
lib compiled with mingw and that is OpenBlas, it requires a
fortran-compiler, as a result I'm stuck with a dll for that one :-(.

degski via Boost

unread,
Apr 29, 2017, 12:30:02 PM4/29/17
to boost, degski
On 16 April 2016 at 17:58, Edward Diener <eldi...@tropicsoft.com> wrote:

> What I strongly suspect will finally happen is that clang will not fix
> these emulation problems because they are too tricky and numerous to do.
> Instead they will probably declare that their emulation is good enough for
> the majority of preprocessor constructs and that Boost PP, which pushes the
> preprocessor to its limits, is not meant to work with their flawed VC++
> emulation. I hope I am wrong about that supposition, but having spent much
> time in Boost PP and Boost VMD trying to workaround VC++ non-standard
> preprocessor behavior I can envision that having to code "down" to that
> behavior in numerous complicated instances will be too much time consuming
> work for the clang developers who have chosen to work with VC++
> preprocessor emulation.
>


I've successfully built boost-1.64 with VC1410 (from the developer command
prompt). Trying to use boost with a project using Clang 4.0.0 (both the
LLVM and C2 backends) gives me the following PP error messages:


1>------ Rebuild All started: Project: test, Configuration: Debug x64 ------
1> In file included from test.cpp:16:
1> In file included from z:\vc\x64\include\boost/filesystem.hpp:16:
1> In file included from z:\vc\x64\include\boost/filesystem/path.hpp:28:
1> In file included from
z:\vc\x64\include\boost/iterator/iterator_facade.hpp:12:
1> In file included from
z:\vc\x64\include\boost/iterator/interoperable.hpp:11:
1> In file included from z:\vc\x64\include\boost/mpl/or.hpp:43:
1> In file included from
z:\vc\x64\include\boost/mpl/aux_/include_preprocessed.hpp:37:
1>z:\vc\x64\include\boost/mpl/aux_/preprocessed/plain/or.hpp(59,7): error :
too many arguments provided to function-like macro invocation
1> 2
1> ^
1> z:\vc\x64\include\boost/preprocessor/facilities/expand.hpp(26,10):
note: macro 'BOOST_PP_EXPAND_I' defined here
1> # define BOOST_PP_EXPAND_I(x) x
1> ^
1> In file included from test.cpp:16:
1> In file included from z:\vc\x64\include\boost/filesystem.hpp:16:
1> In file included from z:\vc\x64\include\boost/filesystem/path.hpp:28:
1> In file included from
z:\vc\x64\include\boost/iterator/iterator_facade.hpp:12:
1> In file included from
z:\vc\x64\include\boost/iterator/interoperable.hpp:11:
1> In file included from z:\vc\x64\include\boost/mpl/or.hpp:43:
1> In file included from
z:\vc\x64\include\boost/mpl/aux_/include_preprocessed.hpp:37:
1>z:\vc\x64\include\boost/mpl/aux_/preprocessed/plain/or.hpp(58,1): error :
expected a qualified name after 'typename'
1> BOOST_MPL_AUX_NA_SPEC2(
1> ^
1> z:\vc\x64\include\boost/mpl/aux_/na_spec.hpp(166,44): note: expanded
from macro 'BOOST_MPL_AUX_NA_SPEC2'
1> #define BOOST_MPL_AUX_NA_SPEC2(i, j, name) \
1> ^
1> z:\vc\x64\include\boost/mpl/aux_/na_spec.hpp(64,11): note: expanded
from macro '\
1>
1> BOOST_MPL_AUX_NA_SPEC_MAIN'
1> BOOST_MPL_PP_PARAMS(i, typename T) \
1> ^
1> z:\vc\x64\include\boost/mpl/aux_/preprocessor/params.hpp(58,11): note:
expanded from macro 'BOOST_MPL_PP_PARAMS'
1> , BOOST_MPL_PP_AUX_PARAM_FUNC \
1> ^
1> In file included from test.cpp:16:
1> In file included from z:\vc\x64\include\boost/filesystem.hpp:16:
1> In file included from z:\vc\x64\include\boost/filesystem/path.hpp:28:
1> In file included from
z:\vc\x64\include\boost/iterator/iterator_facade.hpp:12:
1> In file included from
z:\vc\x64\include\boost/iterator/interoperable.hpp:11:
1> In file included from z:\vc\x64\include\boost/mpl/or.hpp:43:
1> In file included from
z:\vc\x64\include\boost/mpl/aux_/include_preprocessed.hpp:37:
1>z:\vc\x64\include\boost/mpl/aux_/preprocessed/plain/or.hpp(58,1): error :
expected ',' or '>' in template-parameter-list
1> z:\vc\x64\include\boost/mpl/aux_/na_spec.hpp(166,44): note: expanded
from macro 'BOOST_MPL_AUX_NA_SPEC2'
1> #define BOOST_MPL_AUX_NA_SPEC2(i, j, name) \
1> ^
1> z:\vc\x64\include\boost/mpl/aux_/na_spec.hpp(65,9): note: expanded
from macro '\
1>
1> BOOST_MPL_AUX_NA_SPEC_MAIN'
1> BOOST_MPL_PP_NESTED_DEF_PARAMS_TAIL(i, typename T, na) \
1> ^
1>
z:\vc\x64\include\boost/mpl/aux_/preprocessor/def_params_tail.hpp(97,5):
note: expanded from macro 'BOOST_MPL_PP_NESTED_DEF_PARAMS_TAIL'
1> BOOST_MPL_PP_DEF_PARAMS_TAIL_IMPL(i, param,
BOOST_PP_IDENTITY(=value)) \
1> ^
1> note: (skipping 2 expansions in backtrace; use
-fmacro-backtrace-limit=0 to see all)
1> z:\vc\x64\include\boost/preprocessor/cat.hpp(22,32): note: expanded
from macro 'BOOST_PP_CAT'
1> # define BOOST_PP_CAT(a, b) BOOST_PP_CAT_I(a, b)
1> ^
1> z:\vc\x64\include\boost/preprocessor/cat.hpp(31,53): note: expanded
from macro 'BOOST_PP_CAT_I'
1> # define BOOST_PP_CAT_I(a, b) BOOST_PP_CAT_II(~, a ## b)
1> ^
1> <scratch space>(8,1): note: expanded from here
1> BOOST_PP_REPEAT_1
1> ^
1> In file included from test.cpp:16:
1> In file included from z:\vc\x64\include\boost/filesystem.hpp:16:
1> In file included from z:\vc\x64\include\boost/filesystem/path.hpp:28:
1> In file included from
z:\vc\x64\include\boost/iterator/iterator_facade.hpp:12:
1> In file included from
z:\vc\x64\include\boost/iterator/interoperable.hpp:11:
1> In file included from z:\vc\x64\include\boost/mpl/or.hpp:43:
1> In file included from
z:\vc\x64\include\boost/mpl/aux_/include_preprocessed.hpp:37:
1>z:\vc\x64\include\boost/mpl/aux_/preprocessed/plain/or.hpp(58,1): error :
template argument for template type parameter must be a type
1> BOOST_MPL_AUX_NA_SPEC2(
1> ^~~~~~~~~~~~~~~~~~~~~~~
1> z:\vc\x64\include\boost/mpl/aux_/na_spec.hpp(166,44): note: expanded
from macro 'BOOST_MPL_AUX_NA_SPEC2'
1> #define BOOST_MPL_AUX_NA_SPEC2(i, j, name) \
1> ^
1> z:\vc\x64\include\boost/mpl/aux_/na_spec.hpp(68,17): note: expanded
from macro '\
1>
1> BOOST_MPL_AUX_NA_SPEC_MAIN'
1> : name< BOOST_MPL_PP_PARAMS(i, T) > \
1> ^~~~~~~~~~~~~~~~~~~~~~~~~
1> z:\vc\x64\include\boost/mpl/aux_/preprocessor/params.hpp(58,11): note:
expanded from macro 'BOOST_MPL_PP_PARAMS'
1> , BOOST_MPL_PP_AUX_PARAM_FUNC \
1> ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1> note: (skipping 5 expansions in backtrace; use
-fmacro-backtrace-limit=0 to see all)
1> z:\vc\x64\include\boost/preprocessor/cat.hpp(31,53): note: expanded
from macro 'BOOST_PP_CAT_I'
1> # define BOOST_PP_CAT_I(a, b) BOOST_PP_CAT_II(~, a ## b)
1> ^~~~~~
1> <scratch space>(33,1): note: expanded from here
1> T2
1> ^~
1> z:\vc\x64\include\boost/preprocessor/cat.hpp(32,37): note: expanded
from macro 'BOOST_PP_CAT_II'
1> # define BOOST_PP_CAT_II(p, res) res
1> ^~~
1> z:\vc\x64\include\boost/mpl/aux_/preprocessed/plain/or.hpp(45,39):
note: template parameter is declared here
1> , typename BOOST_MPL_AUX_NA_PARAM(T2)
1> ^
1> In file included from test.cpp:16:
1> In file included from z:\vc\x64\include\boost/filesystem.hpp:16:
1> In file included from z:\vc\x64\include\boost/filesystem/path.hpp:28:
1> In file included from
z:\vc\x64\include\boost/iterator/iterator_facade.hpp:14:
1> In file included from
z:\vc\x64\include\boost/iterator/iterator_categories.hpp:15:
1> In file included from z:\vc\x64\include\boost/mpl/eval_if.hpp:17:
1>z:\vc\x64\include\boost/mpl/if.hpp(131,23): error : too many arguments
provided to function-like macro invocation
1> BOOST_MPL_AUX_NA_SPEC(3, if_)
1> ^
1> z:\vc\x64\include\boost/preprocessor/facilities/expand.hpp(26,10):
note: macro 'BOOST_PP_EXPAND_I' defined here
1> # define BOOST_PP_EXPAND_I(x) x
1> ^
1> In file included from test.cpp:16:
1> In file included from z:\vc\x64\include\boost/filesystem.hpp:16:
1> In file included from z:\vc\x64\include\boost/filesystem/path.hpp:28:
1> In file included from
z:\vc\x64\include\boost/iterator/iterator_facade.hpp:14:
1> In file included from
z:\vc\x64\include\boost/iterator/iterator_categories.hpp:15:
1> In file included from z:\vc\x64\include\boost/mpl/eval_if.hpp:17:
1>z:\vc\x64\include\boost/mpl/if.hpp(131,1): error : expected a qualified
name after 'typename'
1> BOOST_MPL_AUX_NA_SPEC(3, if_)
1> ^
1> z:\vc\x64\include\boost/mpl/aux_/na_spec.hpp(161,40): note: expanded
from macro 'BOOST_MPL_AUX_NA_SPEC'
1> #define BOOST_MPL_AUX_NA_SPEC(i, name) \
1> ^
1> z:\vc\x64\include\boost/mpl/aux_/na_spec.hpp(154,47): note: expanded
from macro '\
1>
1> BOOST_MPL_AUX_NA_SPEC_NO_ETI'
1> #define BOOST_MPL_AUX_NA_SPEC_NO_ETI(i, name) \
1> ^
1> z:\vc\x64\include\boost/mpl/aux_/na_spec.hpp(64,11): note: expanded
from macro '\
1>
1> BOOST_MPL_AUX_NA_SPEC_MAIN'
1> BOOST_MPL_PP_PARAMS(i, typename T) \
1> ^
1> z:\vc\x64\include\boost/mpl/aux_/preprocessor/params.hpp(58,11): note:
expanded from macro 'BOOST_MPL_PP_PARAMS'
1> , BOOST_MPL_PP_AUX_PARAM_FUNC \
1> ^
1> In file included from test.cpp:16:
1> In file included from z:\vc\x64\include\boost/filesystem.hpp:16:
1> In file included from z:\vc\x64\include\boost/filesystem/path.hpp:28:
1> In file included from
z:\vc\x64\include\boost/iterator/iterator_facade.hpp:14:
1> In file included from
z:\vc\x64\include\boost/iterator/iterator_categories.hpp:15:
1> In file included from z:\vc\x64\include\boost/mpl/eval_if.hpp:17:
1>z:\vc\x64\include\boost/mpl/if.hpp(131,1): error : expected ',' or '>' in
template-parameter-list
1> z:\vc\x64\include\boost/mpl/aux_/na_spec.hpp(161,40): note: expanded
from macro 'BOOST_MPL_AUX_NA_SPEC'
1> #define BOOST_MPL_AUX_NA_SPEC(i, name) \
1> ^
1> z:\vc\x64\include\boost/mpl/aux_/na_spec.hpp(154,47): note: expanded
from macro '\
1>
1> BOOST_MPL_AUX_NA_SPEC_NO_ETI'
1> #define BOOST_MPL_AUX_NA_SPEC_NO_ETI(i, name) \
1> ^
1> z:\vc\x64\include\boost/mpl/aux_/na_spec.hpp(65,9): note: expanded
from macro '\
1>
1> BOOST_MPL_AUX_NA_SPEC_MAIN'
1> BOOST_MPL_PP_NESTED_DEF_PARAMS_TAIL(i, typename T, na) \
1> ^
1> note: (skipping 3 expansions in backtrace; use
-fmacro-backtrace-limit=0 to see all)
1> z:\vc\x64\include\boost/preprocessor/cat.hpp(22,32): note: expanded
from macro 'BOOST_PP_CAT'
1> # define BOOST_PP_CAT(a, b) BOOST_PP_CAT_I(a, b)
1> ^
1> z:\vc\x64\include\boost/preprocessor/cat.hpp(31,53): note: expanded
from macro 'BOOST_PP_CAT_I'
1> # define BOOST_PP_CAT_I(a, b) BOOST_PP_CAT_II(~, a ## b)
1> ^
1> <scratch space>(4,1): note: expanded from here
1> BOOST_PP_REPEAT_1
1> ^
1> In file included from test.cpp:16:
1> In file included from z:\vc\x64\include\boost/filesystem.hpp:16:
1> In file included from z:\vc\x64\include\boost/filesystem/path.hpp:28:
1> In file included from
z:\vc\x64\include\boost/iterator/iterator_facade.hpp:14:
1> In file included from
z:\vc\x64\include\boost/iterator/iterator_categories.hpp:15:
1> In file included from z:\vc\x64\include\boost/mpl/eval_if.hpp:17:
1>z:\vc\x64\include\boost/mpl/if.hpp(131,1): error : template argument for
template type parameter must be a type
1> BOOST_MPL_AUX_NA_SPEC(3, if_)
1> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1> z:\vc\x64\include\boost/mpl/aux_/na_spec.hpp(161,40): note: expanded
from macro 'BOOST_MPL_AUX_NA_SPEC'
1> #define BOOST_MPL_AUX_NA_SPEC(i, name) \
1> ^
1> z:\vc\x64\include\boost/mpl/aux_/na_spec.hpp(154,47): note: expanded
from macro '\
1>
1> BOOST_MPL_AUX_NA_SPEC_NO_ETI'
1> #define BOOST_MPL_AUX_NA_SPEC_NO_ETI(i, name) \
1> ^
1> z:\vc\x64\include\boost/mpl/aux_/na_spec.hpp(68,17): note: expanded
from macro '\
1>
1> BOOST_MPL_AUX_NA_SPEC_MAIN'
1> : name< BOOST_MPL_PP_PARAMS(i, T) > \
1> ^~~~~~~~~~~~~~~~~~~~~~~~~
1> note: (skipping 6 expansions in backtrace; use
-fmacro-backtrace-limit=0 to see all)
1> z:\vc\x64\include\boost/preprocessor/cat.hpp(31,53): note: expanded
from macro 'BOOST_PP_CAT_I'
1> # define BOOST_PP_CAT_I(a, b) BOOST_PP_CAT_II(~, a ## b)
1> ^~~~~~
1> <scratch space>(29,1): note: expanded from here
1> T3
1> ^~
1> z:\vc\x64\include\boost/preprocessor/cat.hpp(32,37): note: expanded
from macro 'BOOST_PP_CAT_II'
1> # define BOOST_PP_CAT_II(p, res) res
1> ^~~
1> z:\vc\x64\include\boost/mpl/if.hpp(53,39): note: template parameter is
declared here
1> , typename BOOST_MPL_AUX_NA_PARAM(T3)
1> ^
1> In file included from test.cpp:16:
1> In file included from z:\vc\x64\include\boost/filesystem.hpp:16:
1> In file included from z:\vc\x64\include\boost/filesystem/path.hpp:28:
1> In file included from
z:\vc\x64\include\boost/iterator/iterator_facade.hpp:14:
1> In file included from
z:\vc\x64\include\boost/iterator/iterator_categories.hpp:15:
1>z:\vc\x64\include\boost/mpl/eval_if.hpp(67,23): error : too many
arguments provided to function-like macro invocation
1> BOOST_MPL_AUX_NA_SPEC(3, eval_if)
1> ^
1> z:\vc\x64\include\boost/preprocessor/facilities/expand.hpp(26,10):
note: macro 'BOOST_PP_EXPAND_I' defined here
1> # define BOOST_PP_EXPAND_I(x) x
1> ^
1> In file included from test.cpp:16:
1> In file included from z:\vc\x64\include\boost/filesystem.hpp:16:
1> In file included from z:\vc\x64\include\boost/filesystem/path.hpp:28:
1> In file included from
z:\vc\x64\include\boost/iterator/iterator_facade.hpp:14:
1> In file included from
z:\vc\x64\include\boost/iterator/iterator_categories.hpp:15:
1>z:\vc\x64\include\boost/mpl/eval_if.hpp(67,1): error : expected a
qualified name after 'typename'
1> BOOST_MPL_AUX_NA_SPEC(3, eval_if)
1> ^
1> z:\vc\x64\include\boost/mpl/aux_/na_spec.hpp(161,40): note: expanded
from macro 'BOOST_MPL_AUX_NA_SPEC'
1> #define BOOST_MPL_AUX_NA_SPEC(i, name) \
1> ^
1> z:\vc\x64\include\boost/mpl/aux_/na_spec.hpp(154,47): note: expanded
from macro '\
1>
1> BOOST_MPL_AUX_NA_SPEC_NO_ETI'
1> #define BOOST_MPL_AUX_NA_SPEC_NO_ETI(i, name) \
1> ^
1> z:\vc\x64\include\boost/mpl/aux_/na_spec.hpp(64,11): note: expanded
from macro '\
1>
1> BOOST_MPL_AUX_NA_SPEC_MAIN'
1> BOOST_MPL_PP_PARAMS(i, typename T) \
1> ^
1> z:\vc\x64\include\boost/mpl/aux_/preprocessor/params.hpp(58,11): note:
expanded from macro 'BOOST_MPL_PP_PARAMS'
1> , BOOST_MPL_PP_AUX_PARAM_FUNC \
1> ^
1> In file included from test.cpp:16:
1> In file included from z:\vc\x64\include\boost/filesystem.hpp:16:
1> In file included from z:\vc\x64\include\boost/filesystem/path.hpp:28:
1> In file included from
z:\vc\x64\include\boost/iterator/iterator_facade.hpp:14:
1> In file included from
z:\vc\x64\include\boost/iterator/iterator_categories.hpp:15:
1>z:\vc\x64\include\boost/mpl/eval_if.hpp(67,1): error : expected ',' or
'>' in template-parameter-list
1> z:\vc\x64\include\boost/mpl/aux_/na_spec.hpp(161,40): note: expanded
from macro 'BOOST_MPL_AUX_NA_SPEC'
1> #define BOOST_MPL_AUX_NA_SPEC(i, name) \
1> ^
1> z:\vc\x64\include\boost/mpl/aux_/na_spec.hpp(154,47): note: expanded
from macro '\
1>
1> BOOST_MPL_AUX_NA_SPEC_NO_ETI'
1> #define BOOST_MPL_AUX_NA_SPEC_NO_ETI(i, name) \
1> ^
1> z:\vc\x64\include\boost/mpl/aux_/na_spec.hpp(65,9): note: expanded
from macro '\
1>
1> BOOST_MPL_AUX_NA_SPEC_MAIN'
1> BOOST_MPL_PP_NESTED_DEF_PARAMS_TAIL(i, typename T, na) \
1> ^
1> note: (skipping 3 expansions in backtrace; use
-fmacro-backtrace-limit=0 to see all)
1> z:\vc\x64\include\boost/preprocessor/cat.hpp(22,32): note: expanded
from macro 'BOOST_PP_CAT'
1> # define BOOST_PP_CAT(a, b) BOOST_PP_CAT_I(a, b)
1> ^
1> z:\vc\x64\include\boost/preprocessor/cat.hpp(31,53): note: expanded
from macro 'BOOST_PP_CAT_I'
1> # define BOOST_PP_CAT_I(a, b) BOOST_PP_CAT_II(~, a ## b)
1> ^
1> <scratch space>(29,1): note: expanded from here
1> BOOST_PP_REPEAT_1
1> ^
1> In file included from test.cpp:16:
1> In file included from z:\vc\x64\include\boost/filesystem.hpp:16:
1> In file included from z:\vc\x64\include\boost/filesystem/path.hpp:28:
1> In file included from
z:\vc\x64\include\boost/iterator/iterator_facade.hpp:14:
1> In file included from
z:\vc\x64\include\boost/iterator/iterator_categories.hpp:15:
1>z:\vc\x64\include\boost/mpl/eval_if.hpp(67,1): error : template argument
for template type parameter must be a type
1> BOOST_MPL_AUX_NA_SPEC(3, eval_if)
1> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1> z:\vc\x64\include\boost/mpl/aux_/na_spec.hpp(161,40): note: expanded
from macro 'BOOST_MPL_AUX_NA_SPEC'
1> #define BOOST_MPL_AUX_NA_SPEC(i, name) \
1> ^
1> z:\vc\x64\include\boost/mpl/aux_/na_spec.hpp(154,47): note: expanded
from macro '\
1>
1> BOOST_MPL_AUX_NA_SPEC_NO_ETI'
1> #define BOOST_MPL_AUX_NA_SPEC_NO_ETI(i, name) \
1> ^
1> z:\vc\x64\include\boost/mpl/aux_/na_spec.hpp(68,17): note: expanded
from macro '\
1>
1> BOOST_MPL_AUX_NA_SPEC_MAIN'
1> : name< BOOST_MPL_PP_PARAMS(i, T) > \
1> ^~~~~~~~~~~~~~~~~~~~~~~~~
1> note: (skipping 6 expansions in backtrace; use
-fmacro-backtrace-limit=0 to see all)
1> z:\vc\x64\include\boost/preprocessor/cat.hpp(31,53): note: expanded
from macro 'BOOST_PP_CAT_I'
1> # define BOOST_PP_CAT_I(a, b) BOOST_PP_CAT_II(~, a ## b)
1> ^~~~~~
1> <scratch space>(32,1): note: expanded from here
1> T3
1> ^~
1> z:\vc\x64\include\boost/preprocessor/cat.hpp(32,37): note: expanded
from macro 'BOOST_PP_CAT_II'
1> # define BOOST_PP_CAT_II(p, res) res
1> ^~~
1> z:\vc\x64\include\boost/mpl/eval_if.hpp(29,39): note: template
parameter is declared here
1> , typename BOOST_MPL_AUX_NA_PARAM(F2)
1> ^
1> In file included from test.cpp:16:
1> In file included from z:\vc\x64\include\boost/filesystem.hpp:16:
1> In file included from z:\vc\x64\include\boost/filesystem/path.hpp:28:
1> In file included from
z:\vc\x64\include\boost/iterator/iterator_facade.hpp:14:
1> In file included from
z:\vc\x64\include\boost/iterator/iterator_categories.hpp:16:
1>z:\vc\x64\include\boost/mpl/identity.hpp(40,30): error : too many
arguments provided to function-like macro invocation
1> BOOST_MPL_AUX_NA_SPEC_NO_ETI(1, identity)
1> ^
1> z:\vc\x64\include\boost/preprocessor/facilities/expand.hpp(26,10):
note: macro 'BOOST_PP_EXPAND_I' defined here
1> # define BOOST_PP_EXPAND_I(x) x
1> ^
1> In file included from test.cpp:16:
1> In file included from z:\vc\x64\include\boost/filesystem.hpp:16:
1> In file included from z:\vc\x64\include\boost/filesystem/path.hpp:28:
1> In file included from
z:\vc\x64\include\boost/iterator/iterator_facade.hpp:14:
1> In file included from
z:\vc\x64\include\boost/iterator/iterator_categories.hpp:16:
1>z:\vc\x64\include\boost/mpl/identity.hpp(40,1): error : expected a
qualified name after 'typename'
1> BOOST_MPL_AUX_NA_SPEC_NO_ETI(1, identity)
1> ^
1> z:\vc\x64\include\boost/mpl/aux_/na_spec.hpp(154,47): note: expanded
from macro 'BOOST_MPL_AUX_NA_SPEC_NO_ETI'
1> #define BOOST_MPL_AUX_NA_SPEC_NO_ETI(i, name) \
1> ^
1> z:\vc\x64\include\boost/mpl/aux_/na_spec.hpp(64,11): note: expanded
from macro '\
1>
1> BOOST_MPL_AUX_NA_SPEC_MAIN'
1> BOOST_MPL_PP_PARAMS(i, typename T) \
1> ^
1> z:\vc\x64\include\boost/mpl/aux_/preprocessor/params.hpp(58,11): note:
expanded from macro 'BOOST_MPL_PP_PARAMS'
1> , BOOST_MPL_PP_AUX_PARAM_FUNC \
1> ^
1> In file included from test.cpp:16:
1> In file included from z:\vc\x64\include\boost/filesystem.hpp:16:
1> In file included from z:\vc\x64\include\boost/filesystem/path.hpp:28:
1> In file included from
z:\vc\x64\include\boost/iterator/iterator_facade.hpp:14:
1> In file included from
z:\vc\x64\include\boost/iterator/iterator_categories.hpp:16:
1>z:\vc\x64\include\boost/mpl/identity.hpp(40,1): error : expected ',' or
'>' in template-parameter-list
1> z:\vc\x64\include\boost/mpl/aux_/na_spec.hpp(154,47): note: expanded
from macro 'BOOST_MPL_AUX_NA_SPEC_NO_ETI'
1> #define BOOST_MPL_AUX_NA_SPEC_NO_ETI(i, name) \
1> ^
1> z:\vc\x64\include\boost/mpl/aux_/na_spec.hpp(65,9): note: expanded
from macro '\
1>
1> BOOST_MPL_AUX_NA_SPEC_MAIN'
1> BOOST_MPL_PP_NESTED_DEF_PARAMS_TAIL(i, typename T, na) \
1> ^
1>
z:\vc\x64\include\boost/mpl/aux_/preprocessor/def_params_tail.hpp(97,5):
note: expanded from macro 'BOOST_MPL_PP_NESTED_DEF_PARAMS_TAIL'
1> BOOST_MPL_PP_DEF_PARAMS_TAIL_IMPL(i, param,
BOOST_PP_IDENTITY(=value)) \
1> ^
1> note: (skipping 2 expansions in backtrace; use
-fmacro-backtrace-limit=0 to see all)
1> z:\vc\x64\include\boost/preprocessor/cat.hpp(22,32): note: expanded
from macro 'BOOST_PP_CAT'
1> # define BOOST_PP_CAT(a, b) BOOST_PP_CAT_I(a, b)
1> ^
1> z:\vc\x64\include\boost/preprocessor/cat.hpp(31,53): note: expanded
from macro 'BOOST_PP_CAT_I'
1> # define BOOST_PP_CAT_I(a, b) BOOST_PP_CAT_II(~, a ## b)
1> ^
1> <scratch space>(32,1): note: expanded from here
1> BOOST_PP_REPEAT_1
1> ^
1> In file included from test.cpp:16:
1> In file included from z:\vc\x64\include\boost/filesystem.hpp:16:
1> In file included from z:\vc\x64\include\boost/filesystem/path.hpp:28:
1> In file included from
z:\vc\x64\include\boost/iterator/iterator_facade.hpp:14:
1> In file included from
z:\vc\x64\include\boost/iterator/iterator_categories.hpp:16:
1>z:\vc\x64\include\boost/mpl/identity.hpp(40,1): error : template argument
for template type parameter must be a type
1> BOOST_MPL_AUX_NA_SPEC_NO_ETI(1, identity)
1> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1> z:\vc\x64\include\boost/mpl/aux_/na_spec.hpp(154,47): note: expanded
from macro 'BOOST_MPL_AUX_NA_SPEC_NO_ETI'
1> #define BOOST_MPL_AUX_NA_SPEC_NO_ETI(i, name) \
1> ^
1> z:\vc\x64\include\boost/mpl/aux_/na_spec.hpp(68,17): note: expanded
from macro '\
1>
1> BOOST_MPL_AUX_NA_SPEC_MAIN'
1> : name< BOOST_MPL_PP_PARAMS(i, T) > \
1> ^~~~~~~~~~~~~~~~~~~~~~~~~
1> z:\vc\x64\include\boost/mpl/aux_/preprocessor/params.hpp(58,11): note:
expanded from macro 'BOOST_MPL_PP_PARAMS'
1> , BOOST_MPL_PP_AUX_PARAM_FUNC \
1> ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1> note: (skipping 5 expansions in backtrace; use
-fmacro-backtrace-limit=0 to see all)
1> z:\vc\x64\include\boost/preprocessor/cat.hpp(31,53): note: expanded
from macro 'BOOST_PP_CAT_I'
1> # define BOOST_PP_CAT_I(a, b) BOOST_PP_CAT_II(~, a ## b)
1> ^~~~~~
1> <scratch space>(32,1): note: expanded from here
1> T1
1> ^~
1> z:\vc\x64\include\boost/preprocessor/cat.hpp(32,37): note: expanded
from macro 'BOOST_PP_CAT_II'
1> # define BOOST_PP_CAT_II(p, res) res
1> ^~~
1> z:\vc\x64\include\boost/mpl/identity.hpp(23,39): note: template
parameter is declared here
1> typename BOOST_MPL_AUX_NA_PARAM(T)
1> ^
1>z:\vc\x64\include\boost/mpl/identity.hpp(41,30): error : too many
arguments provided to function-like macro invocation
1> BOOST_MPL_AUX_NA_SPEC_NO_ETI(1, make_identity)
1> ^
1> z:\vc\x64\include\boost/preprocessor/facilities/expand.hpp(26,10):
note: macro 'BOOST_PP_EXPAND_I' defined here
1> # define BOOST_PP_EXPAND_I(x) x
1> ^
1> In file included from test.cpp:16:
1> In file included from z:\vc\x64\include\boost/filesystem.hpp:16:
1> In file included from z:\vc\x64\include\boost/filesystem/path.hpp:28:
1> In file included from
z:\vc\x64\include\boost/iterator/iterator_facade.hpp:14:
1> In file included from
z:\vc\x64\include\boost/iterator/iterator_categories.hpp:16:
1>z:\vc\x64\include\boost/mpl/identity.hpp(41,1): error : expected a
qualified name after 'typename'
1> BOOST_MPL_AUX_NA_SPEC_NO_ETI(1, make_identity)
1> ^
1> z:\vc\x64\include\boost/mpl/aux_/na_spec.hpp(154,47): note: expanded
from macro 'BOOST_MPL_AUX_NA_SPEC_NO_ETI'
1> #define BOOST_MPL_AUX_NA_SPEC_NO_ETI(i, name) \
1> ^
1> z:\vc\x64\include\boost/mpl/aux_/na_spec.hpp(64,11): note: expanded
from macro '\
1>
1> BOOST_MPL_AUX_NA_SPEC_MAIN'
1> BOOST_MPL_PP_PARAMS(i, typename T) \
1> ^
1> z:\vc\x64\include\boost/mpl/aux_/preprocessor/params.hpp(58,11): note:
expanded from macro 'BOOST_MPL_PP_PARAMS'
1> , BOOST_MPL_PP_AUX_PARAM_FUNC \
1> ^
1> In file included from test.cpp:16:
1> In file included from z:\vc\x64\include\boost/filesystem.hpp:16:
1> In file included from z:\vc\x64\include\boost/filesystem/path.hpp:28:
1> In file included from
z:\vc\x64\include\boost/iterator/iterator_facade.hpp:14:
1> In file included from
z:\vc\x64\include\boost/iterator/iterator_categories.hpp:16:
1>z:\vc\x64\include\boost/mpl/identity.hpp(41,1): error : expected ',' or
'>' in template-parameter-list
1> z:\vc\x64\include\boost/mpl/aux_/na_spec.hpp(154,47): note: expanded
from macro 'BOOST_MPL_AUX_NA_SPEC_NO_ETI'
1> #define BOOST_MPL_AUX_NA_SPEC_NO_ETI(i, name) \
1> ^
1> z:\vc\x64\include\boost/mpl/aux_/na_spec.hpp(65,9): note: expanded
from macro '\
1>
1> BOOST_MPL_AUX_NA_SPEC_MAIN'
1> BOOST_MPL_PP_NESTED_DEF_PARAMS_TAIL(i, typename T, na) \
1> ^
1>
z:\vc\x64\include\boost/mpl/aux_/preprocessor/def_params_tail.hpp(97,5):
note: expanded from macro 'BOOST_MPL_PP_NESTED_DEF_PARAMS_TAIL'
1> BOOST_MPL_PP_DEF_PARAMS_TAIL_IMPL(i, param,
BOOST_PP_IDENTITY(=value)) \
1> ^
1> note: (skipping 2 expansions in backtrace; use
-fmacro-backtrace-limit=0 to see all)
1> z:\vc\x64\include\boost/preprocessor/cat.hpp(22,32): note: expanded
from macro 'BOOST_PP_CAT'
1> # define BOOST_PP_CAT(a, b) BOOST_PP_CAT_I(a, b)
1> ^
1> z:\vc\x64\include\boost/preprocessor/cat.hpp(31,53): note: expanded
from macro 'BOOST_PP_CAT_I'
1> # define BOOST_PP_CAT_I(a, b) BOOST_PP_CAT_II(~, a ## b)
1> ^
1> <scratch space>(61,1): note: expanded from here
1> BOOST_PP_REPEAT_1
1> ^
1>CL : fatal error : too many errors emitted, stopping now [-ferror-limit=]
1> 20 errors generated.
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========


Up till now I was using a hacked boost-1.62. So in order to see what would
happen, I also built boost-1.63. Apart from a small change in
type_with_alignment.hpp (adding a ckeck for _MSC_VER not to exist if
__clang__ does exist in line 87), boost-1.63 compiles without a problem (no
specific (relevant to the emulation) command line parameters).

Is there a macro I should define or is there something else I should set/do
in order to use boost-1.64 with Clang 4.0.0 on windows? Any other
suggestions?

degski
--
"*Ihre sogenannte Religion wirkt bloß wie ein Opiat reizend, betäubend,
Schmerzen aus Schwäche stillend.*" - Novalis 1798

degski via Boost

unread,
Apr 29, 2017, 12:30:05 PM4/29/17
to boost, degski

x_/include_preprocessed.hpp:37:
1>z:\vc\x64\include\boost/mpl/aux_/preprocessed/plain/or.hpp(58,1): error :
expected a qualified name after 'typename'
1> BOOST_MPL_AUX_NA_SPEC2(
1> ^
1> z:\vc\x64\include\boost/mpl/aux_/na_spec.hpp(166,44): note: expanded
from macro 'BOOST_MPL_AUX_NA_SPEC2'
1> #define BOOST_MPL_AUX_NA_SPEC2(i, j, name) \
1> ^
1> z:\vc\x64\include\boost/mpl/aux_/na_spec.hpp(64,11): note: expanded
from macro '\
1>
1> BOOST_MPL_AUX_NA_SPEC_MAIN'
1> BOOST_MPL_PP_PARAMS(i, typename T) \
1> ^
1> z:\vc\x64\include\boost/mpl/aux_/preprocessor/params.hpp(58,11): note:
expanded from macro 'BOOST_MPL_PP_PARAMS'
1> , BOOST_MPL_PP_AUX_PARAM_FUNC \
1> ^
1> In file included from test.cpp:16:
1> In file included from z:\vc\x64\include\boost/filesystem.hpp:16:
1> In file included from z:\vc\x64\include\boost/filesystem/path.hpp:28:
1> In file included from z:\vc\x64\include\boost/iterat

or/iterator_facade.hpp:12:
1> In file included from z:\vc\x64\include\boost/iterat
or/interoperable.hpp:11:
1> In file included from z:\vc\x64\include\boost/mpl/or.hpp:43:
1> In file included from z:\vc\x64\include\boost/mpl/au

x_/include_preprocessed.hpp:37:
1>z:\vc\x64\include\boost/mpl/aux_/preprocessed/plain/or.hpp(58,1): error :
expected ',' or '>' in template-parameter-list

Edward Diener via Boost

unread,
Apr 29, 2017, 2:52:02 PM4/29/17
to bo...@lists.boost.org, Edward Diener
On 4/29/2017 3:58 AM, degski via Boost wrote:
> On 16 April 2016 at 17:58, Edward Diener <eldi...@tropicsoft.com> wrote:
>
>> What I strongly suspect will finally happen is that clang will not fix
>> these emulation problems because they are too tricky and numerous to do.
>> Instead they will probably declare that their emulation is good enough for
>> the majority of preprocessor constructs and that Boost PP, which pushes the
>> preprocessor to its limits, is not meant to work with their flawed VC++
>> emulation. I hope I am wrong about that supposition, but having spent much
>> time in Boost PP and Boost VMD trying to workaround VC++ non-standard
>> preprocessor behavior I can envision that having to code "down" to that
>> behavior in numerous complicated instances will be too much time consuming
>> work for the clang developers who have chosen to work with VC++
>> preprocessor emulation.
>>
>
>
> I've successfully built boost-1.64 with VC1410 (from the developer command
> prompt). Trying to use boost with a project using Clang 4.0.0 (both the
> LLVM and C2 backends) gives me the following PP error messages:

What are you trying to compile/build/run ?

As explained Boost PP does not support clang-cl, which has a buggy
emulation of the non-standard VC++ preprocessor. In Boost, using:

using clang : 4.0 : some_path/clang++
:
<cxxflags>-fmacro-backtrace-limit=0
<cxxflags>-Wno-invalid-token-paste
<compileflags>-fmsc-version=1900
<linkflags>-fuse-ld=lld
;

you should be able to compile/build Boost libraries. A change was made
to Boost PP to support this by having Boost PP use a C++ standard
preprocessor whenever both _MSC_VER and __clang__ was defined. This
decision was based on the fact that VC++'s clang/c2 uses this mode and
should work using the normal Boost Build clang.jam instead of clang-win.jam.

degski via Boost

unread,
Apr 30, 2017, 2:53:59 AM4/30/17
to boost, degski
On 29 April 2017 at 21:51, Edward Diener via Boost <bo...@lists.boost.org>
wrote:

> What are you trying to compile/build/run ?
>

An application that pulls in the boost::file_system headers. I am not
trying to build boost with clang. For completeness sake, I have the
following PP defines:

__clang__
BOOST_SP_USE_STD_ATOMIC
BOOST_MSVC=1900
BOOST_HAS_MS_INT64

> As explained Boost PP does not support clang-cl, which has a buggy
> emulation of the non-standard VC++ preprocessor.


You have expressed your point of view before and very clearly.

In Boost, using:
>
> using clang : 4.0 : some_path/clang++
> :
> <cxxflags>-fmacro-backtrace-limit=0
> <cxxflags>-Wno-invalid-token-paste
> <compileflags>-fmsc-version=1900
> <linkflags>-fuse-ld=lld
> ;
>

I will eventually try this, thanks for it.


> A change was made to Boost PP to support this by having Boost PP use a C++
> standard preprocessor whenever both _MSC_VER and __clang__ was defined.


Although we can now (with the above change) build boost with clang, this
also implies that we can now NOT use boost in a project on windows (i.e.
with windows headers), as the C++ standard preprocessor (the one that gets
used) does not play well with the Dinkumware-STL. If it is not clear what I
mean, please say so.


> This decision was based on the fact that VC++'s clang/c2 uses this mode
> and should work using the normal Boost Build clang.jam instead of
> clang-win.jam.
>

As I wrote before, the same PP errors are generated with both Clang/LLVM
and Clang/C2, there is no difference in behaviour between the two.

There is an additional issue that AFAICS (due to the (relatively
simplistic) way things are done by the clang team) there is no way to call
clang++.exe from the IDE. All compilers supplied by Clang/LLVM are just
copies of the same file with different names (same hash values for all
(compiler) files). A different name invokes different behaviour. msbuild
calls C:\Program Files (x86)\LLVM\msbuild-bin\cl.exe (which is just
another copy of the same compiler).

f.e. to get the build information, one has to use different commands:

>clang++ --version (linux style)
>clang-cl -v (windows style)

even though the only difference is the name (and therefor the command) of
the files.

If you (as I suspect you will) say it's a mess, I fully agree. I do think,
though, that it's less usefull to be able to build boost with clang (as it
also builds with VC), than it is to be able to use boost (compiled,
whatever way) in a project from the IDE.

boost-1.63 works (adjusted), boost-1.64 doesn't, this cannot be seen as
progress IMHO.

If I don't make sense or if I'm missing something, please tell me.

Have a good day,


degski
--
"*Ihre sogenannte Religion wirkt bloß wie ein Opiat reizend, betäubend,
Schmerzen aus Schwäche stillend.*" - Novalis 1798

_______________________________________________

Peter Dimov via Boost

unread,
Apr 30, 2017, 7:41:51 AM4/30/17
to bo...@lists.boost.org, Peter Dimov
> For completeness sake, I have the following PP defines:
>
> __clang__
> BOOST_SP_USE_STD_ATOMIC
> BOOST_MSVC=1900
> BOOST_HAS_MS_INT64

BOOST_MSVC=1900 looks odd; this macro should only be defined when the
compiler is MSVC.

Either way, I tried

#include <boost/filesystem.hpp>

int main()
{
}

with the built-in clang/c2 in 2017 (toolset v141_clang_c2) and it compiled
(using boost develop).

degski via Boost

unread,
Apr 30, 2017, 8:34:46 AM4/30/17
to boost, degski
On 30 April 2017 at 14:41, Peter Dimov via Boost <bo...@lists.boost.org>
wrote:

> BOOST_MSVC=1900 looks odd; this macro should only be defined when the
> compiler is MSVC.
>

No, don't think so. Remember, both __MSC_VER and __clang__ are defined.
With or without this macro, the result is the same, I tried that.


> Either way, I tried
>
> #include <boost/filesystem.hpp>
>
> int main()
> {
> }
>

This works fine for me as well, I get an executable that does nothing. I
also tried it (for you), even including all the headers (just to rule out
some interaction) in the project concerned (many more), same result, still
compiles. Optimisation at work...

degski
--
"*Ihre sogenannte Religion wirkt bloß wie ein Opiat reizend, betäubend,
Schmerzen aus Schwäche stillend.*" - Novalis 1798

_______________________________________________

degski via Boost

unread,
Apr 30, 2017, 8:52:16 AM4/30/17
to boost, degski
On 30 April 2017 at 15:34, degski <deg...@gmail.com> wrote:

> This works fine for me as well, I get an executable that does nothing. I
> also tried it (for you), even including all the headers (just to rule out
> some interaction) in the project concerned (many more), same result, still
> compiles. Optimisation at work...
>

Apologies, no, it doesn't work for me (was erronously including the 1.63
headers). What macros do you have defined? Are you compiling from the IDE?

degski via Boost

unread,
Apr 30, 2017, 9:03:56 AM4/30/17
to boost, degski
I've created a new project, copied your code, same result... The program
(if you can call it that) actually works (compiles) with VC1410, but not
with either of the clang versions.

What am I doing wrong (or differently)?

degski

Peter Dimov via Boost

unread,
Apr 30, 2017, 9:04:01 AM4/30/17
to bo...@lists.boost.org, Peter Dimov
degski wrote:

> Apologies, no, it doesn't work for me (was erronously including the 1.63
> headers). What macros do you have defined? Are you compiling from the IDE?

No macros except the default
(WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)), yes, from the IDE. I'm
not using clang 4 though, but the clang that ships with 2017.

degski via Boost

unread,
Apr 30, 2017, 9:15:12 AM4/30/17
to boost, degski
On 30 April 2017 at 16:03, Peter Dimov via Boost <bo...@lists.boost.org>
wrote:

> No macros except the default (WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)),


> yes, from the IDE. I'm not using clang 4 though, but the clang that ships
> with 2017.
>

I'm also just using (a.o.) the clang that ships with 2017. I don't get
it...

Just a (I would think) stupid question: "Are the generated boost headers
different, if/when compiled with clang++?"

I'm going to do a Schwarzenegger: "I'll be back!"

degski
--
"*Ihre sogenannte Religion wirkt bloß wie ein Opiat reizend, betäubend,
Schmerzen aus Schwäche stillend.*" - Novalis 1798

_______________________________________________

Peter Dimov via Boost

unread,
Apr 30, 2017, 9:59:52 AM4/30/17
to bo...@lists.boost.org, Peter Dimov
degski wrote:

> I'm also just using (a.o.) the clang that ships with 2017. I don't get
> it...

I checked the master branch, works.

Then checked a downloaded 1_64_0, fails:

1>------ Build started: Project: testbed2017, Configuration: Debug
Win32 ------
1>testbed2017.cpp
1>In file included from testbed2017.cpp:1:
1>In file included from D:/boost_1_64_0\boost/filesystem.hpp:16:
1>In file included from D:/boost_1_64_0\boost/filesystem/path.hpp:28:
1>In file included from
D:/boost_1_64_0\boost/iterator/iterator_facade.hpp:12:
1>In file included from D:/boost_1_64_0\boost/iterator/interoperable.hpp:11:
1>In file included from D:/boost_1_64_0\boost/mpl/or.hpp:43:
1>In file included from
D:/boost_1_64_0\boost/mpl/aux_/include_preprocessed.hpp:37:
1>D:/boost_1_64_0\boost/mpl/aux_/preprocessed/gcc/or.hpp(63,1): error :
pasting formed 'BOOST_PP_TUPLE_ELEM_O_3(', an invalid preprocessing token
[-Winvalid-token-paste]
1>BOOST_MPL_AUX_NA_SPEC2(
1>^

This is exactly how clang used to fail before the changes, if I recall.

I'm now checking out the boost-1.64.0 tag to see how it would fare.

Peter Dimov via Boost

unread,
Apr 30, 2017, 10:07:05 AM4/30/17
to bo...@lists.boost.org, Peter Dimov
> I'm now checking out the boost-1.64.0 tag to see how it would fare.

boost-1.64.0 fails as well.

Mystery solved, the changes that fixed clang are not in 1.64.

C:\Projects\boost-git\boost\libs\preprocessor>git log boost-1.64.0..master
commit b19e4deacb7103061f9c2c9efcdd77eaa5877df0
Merge: a627594 dfc1c46
Author: Edward Diener <eldlist...@tropicsoft.com>
Date: Mon Apr 24 12:13:09 2017 -0400

Merge branch 'develop'

commit dfc1c46ecedef21274eb142e267e91400aa33ec8
Author: Edward Diener <eldlist...@tropicsoft.com>
Date: Sun Mar 26 08:51:41 2017 -0700

With _MSC_VER and __clang__ always use strict mode and variadics turned
on w

commit e474eea44f00ba92310ace20add3956adb83f3de
Author: Edward Diener <eldlist...@tropicsoft.com>
Date: Sun Mar 26 01:02:05 2017 -0700

Slight correction to particularize previous change as involving
only -fno-ms

commit b03c6cd3c0f855f22f154424272ef9276ed72594
Author: Edward Diener <eldlist...@tropicsoft.com>
Date: Sat Mar 25 23:22:32 2017 -0700

In the configuration the combination of clang defined and gcc defined
always

Edward Diener via Boost

unread,
Apr 30, 2017, 10:28:23 AM4/30/17
to bo...@lists.boost.org, Edward Diener
On 4/30/2017 10:06 AM, Peter Dimov via Boost wrote:
>> I'm now checking out the boost-1.64.0 tag to see how it would fare.
>
> boost-1.64.0 fails as well.
>
> Mystery solved, the changes that fixed clang are not in 1.64.

I did not put those changes in 1.64. I did not think I had enough time
between when the changes were tested on the 'develop' branch and when
1.64 was closed for all but the most serious changes. I have, as you
discovered, merged those changes to master after 1.64 was out.
Reply all
Reply to author
Forward
0 new messages