C++ Logo

sg10

Advanced search

Re: [SG10] Should the argument to __has_cpp_attribute be expanded by the preprocessor?

From: Nelson, Clark <clark.nelson_at_[hidden]>
Date: Mon, 23 Mar 2015 18:31:23 +0000
> 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.

Clark

Received on 2015-03-23 19:31:30