brintos

brintos / llvm-project-archived public Read only

0
0
Text · 754 B · 6ce482c Raw
23 lines · cpp
1// RUN: %clang_cc1 -fmodules -std=c++11 -emit-pch -o %t %s2// RUN: %clang_cc1 -fmodules -std=c++11 -include-pch %t %s -verify3//4// This test checks for a bug in the deserialization code that was only5// reachable with modules enabled, but actually building and using modules is6// not necessary in order to trigger it, so we just use PCH here to make the7// test simpler.8 9#ifndef HEADER_INCLUDED10#define HEADER_INCLUDED11 12struct X { template <typename T> X(T) {} };13struct Y { Y(X x = [] {}); };14 15#else16 17// This triggers us to load the specialization of X::X for Y's lambda. That18// lambda's context decl must not be loaded as a result of loading the lambda,19// as that would hit a deserialization cycle.20X x = [] {}; // expected-no-diagnostics21 22#endif23