
This change adds additional checks to a few places where a simple struct in C++ code was triggering `errorNYI` in places where no additional handling was needed, and adds a very small amount of trivial initialization. The code now checks for the conditions that do require extra handling before issuing the diagnostic. New tests are added for declaring and using a simple struct in C++ code.
20 lines
533 B
C++
20 lines
533 B
C++
// RUN: not %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir -emit-cir %s -o - 2>&1 | FileCheck %s
|
|
|
|
struct Other {
|
|
int x;
|
|
};
|
|
|
|
struct Trivial {
|
|
int x;
|
|
double y;
|
|
decltype(&Other::x) ptr;
|
|
};
|
|
|
|
// This case has a trivial default constructor, but can't be zero-initialized.
|
|
Trivial t;
|
|
|
|
// Since the case above isn't handled yet, we want a test that verifies that
|
|
// we're failing for the right reason.
|
|
|
|
// CHECK: error: ClangIR code gen Not Yet Implemented: tryEmitPrivateForVarInit: non-zero-initializable cxx record
|