mirror of
https://github.com/llvm/llvm-project.git
synced 2025-05-16 22:06:04 +00:00

Summary: Previsouly clang tried instantiating member initializers even if ctor body was skipped, this caused spurious errors (see the test). Reviewers: sepavloff, klimek Reviewed By: sepavloff Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D41492 llvm-svn: 321520
17 lines
380 B
C++
17 lines
380 B
C++
// RUN: env CINDEXTEST_SKIP_FUNCTION_BODIES=1 c-index-test -test-load-source all %s 2>&1 \
|
|
// RUN: | FileCheck --implicit-check-not "error:" %s
|
|
|
|
|
|
template <class T>
|
|
struct Foo {
|
|
template <class = int>
|
|
Foo(int &a) : a(a) {
|
|
}
|
|
|
|
int &a;
|
|
};
|
|
|
|
|
|
int bar = Foo<int>(bar).a + Foo<int>(bar).a;
|
|
// CHECK-NOT: error: constructor for 'Foo<int>' must explicitly initialize the reference
|