[clang] [clang-tools-extra] Reland [clang][Sema, Lex, Parse] Preprocessor embed in C and C++ (PR #95802)

Mariya Podchishchaeva via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 20 10:56:37 PDT 2024


Fznamznon wrote:

Yes, all bots are big endian. Reproducer is
```
clang -cc1 %s -fsyntax-only -verify -fexperimental-new-constant-interpreter
constexpr int value(int a, int b) {
  return a + b;
}
constexpr int init_list_expr() {
  int vals[] = {
#embed "jk.txt"
  };
  return value(vals[0], vals[1]);
}
constexpr int ExpectedValue = 'j' + 'k';
static_assert(init_list_expr() == ExpectedValue);
```

contents of "jk.txt" is simply "jk".

https://github.com/llvm/llvm-project/pull/95802


More information about the cfe-commits mailing list