You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to MSDN__FUNCDNAME__, __FUNCSIG__, and __FUNCTION__ are non-expandible macros defined as string literals. So, they may be concatenated with other string literals (Compiler Explorer link):
I've tried to tackle this problem in two approaches:
Make expansion of predefined literals directly in StringLiteralParser, however I stumbled upon a fact that I need access to AST in Lex (which is unreasonable to link them together; namely I needed access to PredefinedExpr::ComputeName).
Replace tokens of predefined literals in in Sema::ActOnStringLiteral with string-literal tokens (from scratch buffer).
Yes, (2) feels hacky, but I couldn't came up with any other approach, and unfortunately, it seems that support of this MSFT extension doesn't fit well into the current architecture of clang. Anyways, I've submitted my patch for review; feel free to reject it.
Predefined identifiers like __FUNCTION__ are treated like string
literals in MSVC, which means they can be concatentated together with
an adjacent string literal. Clang now supports this behavior as well,
in Microsoft extensions mode.
Fixesllvm#63563
Differential Revision: https://reviews.llvm.org/D153914
Change-Id: I0ad452508b78acdd189f612eb8e70b4be93b7df6
According to MSDN
__FUNCDNAME__
,__FUNCSIG__
, and__FUNCTION__
are non-expandible macros defined as string literals. So, they may be concatenated with other string literals (Compiler Explorer link):Currently clang in ms-compatible mode does not support this.
Relevant issue: #12161
The text was updated successfully, but these errors were encountered: