[SG10] Should the argument to __has_cpp_attribute be expanded by the preprocessor?
Richard Smith
richard at metafoo.co.uk
Mon Mar 23 20:15:10 CET 2015
On Mon, Mar 23, 2015 at 11:54 AM, John Spicer <jhs at edg.com> wrote:
>
> On Mar 23, 2015, at 2:31 PM, "Nelson, Clark" <clark.nelson at intel.com>
> wrote:
>
> >> We couldn't wok out whether SD-6 intends this to work:
> >>
> >> #define D deprecated
> >> #if __has_cpp_attribute (D)
> >> #endif
> >>
> >> Currently GCC performs macro-expansion but Clang doesn't.
> >
> > Personally, I would say that our default should be that
> __has_cpp_attribute
> > isn't required to have special implications for macro expansion.
> >
> > Of course anyone is free to make the case that it should, but I'd be
> > inclined to put the burden of proof on the proposer (or supporters).
> >
> > We could make it implementation-defined, to leave clang an option for not
> > changing their implementation. But, like Richard, I don't feel strongly
> > about that one way or the other.
> >
>
> I don't have strong feelings about whether or not the expansion occurs.
>
> I do feel somewhat strongly that we should agree on the behavior and
> include that in our recommendations.
>
> I think it would be unfortunate if the feature test macros has subtle
> portability issues of their own.
I agree.
Since we seem to collectively have no strong opinions: I think I very
slightly prefer "expand" over "do not expand" on the basis that
__has_cpp_attribute(X) and [[X]] should be interpreted the same way.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.open-std.org/pipermail/features/attachments/20150323/7db94d7a/attachment.html
More information about the Features
mailing list