| 1 |
// RUN: %clang_cc1 -fmodules -std=c++11 -emit-pch -o %t %s |
| 2 |
// RUN: %clang_cc1 -fmodules -std=c++11 -include-pch %t %s -verify |
| 3 |
// |
| 4 |
// This test checks for a bug in the deserialization code that was only |
| 5 |
// reachable with modules enabled, but actually building and using modules is |
| 6 |
// not necessary in order to trigger it, so we just use PCH here to make the |
| 7 |
// test simpler. |
| 8 |
|
| 9 |
#ifndef HEADER_INCLUDED |
| 10 |
#define HEADER_INCLUDED |
| 11 |
|
| 12 |
struct X { template <typename T> X(T) {} }; |
| 13 |
struct Y { Y(X x = [] {}); }; |
| 14 |
|
| 15 |
#else |
| 16 |
|
| 17 |
// This triggers us to load the specialization of X::X for Y's lambda. That |
| 18 |
// lambda's context decl must not be loaded as a result of loading the lambda, |
| 19 |
// as that would hit a deserialization cycle. |
| 20 |
X x = [] {}; // expected-no-diagnostics |
| 21 |
|
| 22 |
#endif |