mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-02-03 07:38:57 +00:00
95d7ccb70b
eee944e7f adds the new BuiltinBitCastExpr, but does not set the Code member of ASTStmtWriter. This is not correct and causes an assertion failue in ASTStmtWriter::emit() when building PCHs that contain __builtin_bit_cast. This commit adds serialization::EXPR_BUILTIN_BIT_CAST and handles ASTStmtWriter::Code properly. Differential revision: https://reviews.llvm.org/D80360
20 lines
345 B
C++
20 lines
345 B
C++
// RUN: %clang_cc1 -emit-pch -o %t %s
|
|
// RUN: %clang_cc1 -include-pch %t -fsyntax-only -verify %s
|
|
// expected-no-diagnostics
|
|
|
|
#ifndef HEADER
|
|
#define HEADER
|
|
|
|
template <class T, class U>
|
|
constexpr T BuiltinBitCastWrapper(const U &Arg) {
|
|
return __builtin_bit_cast(T, Arg);
|
|
}
|
|
|
|
#else
|
|
|
|
int main() {
|
|
return BuiltinBitCastWrapper<int>(0);
|
|
}
|
|
|
|
#endif
|