[PATCH] D153156: [Clang] CWG1473: do not err on the lack of space after operator""

James Y Knight via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 18 11:44:10 PDT 2023


jyknight added a comment.

In D153156#4599595 <https://reviews.llvm.org/D153156#4599595>, @rZhBoYao wrote:

> What if a programmer is really trying to call operator""b here (albeit ill-formed)

Because that code is ill-formed, Clang diagnosed it with an error by default. Isn't that preferable to accepting it by default?

And disabling the error treats it as string-concat, because that enables users to remain compatible with code written assuming C++98 semantics for macros in string concatenation. (This support was a quite-intentionally added feature, not an accident of implementation!)

FWIW, GCC does the same thing, but with an on-by-default-warning that doesn't even default to error severity. I do think it's OK to remove support for this extension if spec-compliance requires it, but AFAICT, that's not the case here, so I think it would be preferable to preserve the previous behavior.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D153156



More information about the cfe-commits mailing list