annotate clang/test/Modules/lambda-context.cpp @ 266:00f31e85ec16 default tip

Added tag current for changeset 31d058e83c98
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sat, 14 Oct 2023 10:13:55 +0900
parents 1d019706d866
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // RUN: %clang_cc1 -fmodules -std=c++11 -emit-pch -o %t %s
anatofuz
parents:
diff changeset
2 // RUN: %clang_cc1 -fmodules -std=c++11 -include-pch %t %s -verify
anatofuz
parents:
diff changeset
3 //
anatofuz
parents:
diff changeset
4 // This test checks for a bug in the deserialization code that was only
anatofuz
parents:
diff changeset
5 // reachable with modules enabled, but actually building and using modules is
anatofuz
parents:
diff changeset
6 // not necessary in order to trigger it, so we just use PCH here to make the
anatofuz
parents:
diff changeset
7 // test simpler.
anatofuz
parents:
diff changeset
8
anatofuz
parents:
diff changeset
9 #ifndef HEADER_INCLUDED
anatofuz
parents:
diff changeset
10 #define HEADER_INCLUDED
anatofuz
parents:
diff changeset
11
anatofuz
parents:
diff changeset
12 struct X { template <typename T> X(T) {} };
anatofuz
parents:
diff changeset
13 struct Y { Y(X x = [] {}); };
anatofuz
parents:
diff changeset
14
anatofuz
parents:
diff changeset
15 #else
anatofuz
parents:
diff changeset
16
anatofuz
parents:
diff changeset
17 // This triggers us to load the specialization of X::X for Y's lambda. That
anatofuz
parents:
diff changeset
18 // lambda's context decl must not be loaded as a result of loading the lambda,
anatofuz
parents:
diff changeset
19 // as that would hit a deserialization cycle.
anatofuz
parents:
diff changeset
20 X x = [] {}; // expected-no-diagnostics
anatofuz
parents:
diff changeset
21
anatofuz
parents:
diff changeset
22 #endif