llvm-project/clang/test/CodeGenCXX/merge-all-constants-references.cpp
Weverything be2147db05 Remove reference type when checking const structs
ConstStructBuilder::Finalize in CGExprConstant.ccp assumes that the
passed in QualType is a RecordType.  In some instances, the type is a
reference to a RecordType and the reference needs to be removed first.

Differential Revision: https://reviews.llvm.org/D117376
2022-01-28 13:08:58 -08:00

15 lines
206 B
C++

// RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm -fmerge-all-constants %s -o /dev/null
struct A {
};
struct B {
const struct A& a = {};
};
void Test(const struct B&);
void Run() {
Test({});
}