[PATCH] D133853: [AST] Add msvc-specific C++11 attributes

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 22 08:27:56 PDT 2022


aaron.ballman added a comment.

In D133853#3808669 <https://reviews.llvm.org/D133853#3808669>, @RIscRIpt wrote:

> In D133853#3799344 <https://reviews.llvm.org/D133853#3799344>, @aaron.ballman wrote:
>
>> It's a conforming extension in older language modes like C++98, where we couldn't steal the `constexpr` keyword because it's not reserved, which is one benefit to it. Does MSVC support this as far back as C++98?
>
> Tbh, I cannot understand your question in relation to your statement, and where did you get that statement from 🙂

Ah, I forgot that MSVC's `/std:` flag only goes as far back as C++14. I was wondering two things: 1) does MSVC support `[[]]` attributes in C++ modes earlier than C++11 (moot, there is no C++ earlier than 14 for MSVC) and 2) does MSVC support `[[msvc::constexpr]]` in C++ modes earlier than C++11 (also moot). If the answer to both of those questions was "yes", then I'd understand why this attribute exists (it would be a conforming extension in those language modes, where they could not expose `constexpr` as a keyword). Now I'm wondering why the attribute exists at all. If it's functionally equivalent to `constexpr` as a keyword, what are the use cases for the attribute?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D133853/new/

https://reviews.llvm.org/D133853



More information about the cfe-commits mailing list