mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-29 03:46:07 +00:00

The check only runs in debug mode during serialization, but assert()-fail on: struct S { const int& x = 7; }; in C++ mode. Differential Revision: https://reviews.llvm.org/D94804
18 lines
262 B
C
18 lines
262 B
C
// Header for PCH test cxx-reference.cpp
|
|
|
|
typedef char (&LR);
|
|
typedef char (&&RR);
|
|
|
|
char c;
|
|
|
|
char &lr = c;
|
|
char &&rr = 'c';
|
|
LR &lrlr = c;
|
|
LR &&rrlr = c;
|
|
RR &lrrr = c;
|
|
RR &&rrrr = 'c';
|
|
|
|
struct S {
|
|
const int &x = 1; // LifetimeExtendedTemporary inside struct
|
|
};
|