libcxx with Visual C++ : don't redefine _NOEXCEPT when already defined

G M gmisocpp at gmail.com
Mon Jan 6 04:55:59 PST 2014


On Tue, Jan 7, 2014 at 1:37 AM, Yaron Keren <yaron.keren at gmail.com> wrote:

> Hi,
>
> I am using the clang-format plug in for Visual Studio from
> http://llvm.org/builds/
> It reformats:
>
> #  define _NOEXCEPT throw ()
>
>  into
>
> #define _NOEXCEPT throw()
>
> removing all extra whitespaces.
>
> A comment is certainly helpful.
>
> The compiler catching redefinition mismatch is indeed a good thing since
> I'm not sure what __config should do if the definitions don't match. It
> can't just redefine _NOEXCEPT since the client may depend upon the Visual
> C++ definition.
>
> The best solution would be to replace _NOEXCEPT with _LIBCXX_NOEXCEPT so
> there won't be a macro name clash with Visual C++. This is a simple change
> although it will change many files.
> libstdc++ library uses  _GLIBCXX_NOEXCEPT for the purpose
>
>  Is such a change OK?
> if not I'd say your patch is the next best alternative.
>
> Yaron
>
>
> I personally wouldn't object to changing things to _LIBCXX_NOEXCEPT if an
automated tool could make such a change easily and reliably because then we
could also change _NOEXEPT_(x) to _LIBCXX_NOEXCEPT_OP(x) or something which
I find less subtle. Quite what this reliable tool might be though isn't
clear to me. I'm using Windows.

Ultimately I'm happy to let Marshall or Howard or someone make the choice
if a rename is what's best here. If we don't apply clang-format to __config
that often (have we ever used it on __config?) then I'm ok with just making
the token change and fixing it if it ever gets broken again. If it breaks
it, the worst is just a lot of warnings but no code errors.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140107/8b8c5844/attachment.html>


More information about the cfe-commits mailing list