Open Fznamznon opened 4 months ago
@llvm/issue-subscribers-clang-frontend
Author: Mariya Podchishchaeva (Fznamznon)
There are also some more follow-up concerns that were raised on the original PR, starting from https://github.com/llvm/llvm-project/pull/68620#issuecomment-2167525153
I posted a reland https://github.com/llvm/llvm-project/pull/95802 .
Is there a plan to implement a feature test macro for this? In the C++ paper, p1967, a feature test macro, __cpp_pp_embed is proposed. Or is there another way to check if embed is present for C++ that I missed, with some has_extension or has_feature macro?
Is there a plan to implement a feature test macro for this? In the C++ paper, p1967, a feature test macro, __cpp_pp_embed is proposed. Or is there another way to check if embed is present for C++ that I missed, with some has_extension or has_feature macro?
In C, the feature test macro is __STDC_VERSION__
; the feature has not yet been adopted in C++ and so we're in a bit of a holding pattern for what feature test macro we expose there.
Why do you need another feature test macro?
or
should be enough for both C and C++.
I have created PR https://github.com/llvm/llvm-project/pull/97274 to address the second item in the TODO list (Transform tok::annot_embed into a bunch of tokens and inject them back into stream. We might need a new kind of token that directly hold a numerical value.)
Just noticed that #embed
isn't mentioned under in the C23 section of the clang 19 release notes.
Just noticed that
#embed
isn't mentioned under in the C23 section of the clang 19 release notes.
Good catch, the release note seems to have been dropped.
Just noticed that #embed isn't mentioned under in the C23 section of the clang 19 release notes.
Found one more bug via testing against gcc tests https://godbolt.org/z/cffPqhfob Also there is https://github.com/llvm/llvm-project/pull/97274#issuecomment-2228682653 .
embed crash with std::initializer_list https://github.com/llvm/llvm-project/pull/99050#discussion_r1679593276 . The crash itself can be fixed easily, but making clang accept the code seems more complicated.
I merged https://github.com/llvm/llvm-project/pull/68620 this morning. However there are several places to improve the implementation. This issue is to track them as well as for further discussion on the matter. To be done:
EmbedExpr
. Right now the storage will be duplicated if twoEmbedExpr
referencing same data are serialized. Context https://github.com/llvm/llvm-project/pull/68620#discussion_r1625299848tok::annot_embed
into a bunch of tokens and inject them back into stream. We might need a new kind of token that directly hold a numerical value. Context https://github.com/llvm/llvm-project/pull/68620#pullrequestreview-2085206518To be discussed
Please feel free to edit this if I got something wrong.
CC @AaronBallman @jyknight @cor3ntin @jakubjelinek