1 // RUN: %clang_cc1 -std=c++2a -emit-pch %s -o %t
2 // RUN: %clang_cc1 -std=c++2a -include-pch %t -verify %s
4 // RUN: %clang_cc1 -std=c++2a -emit-pch -fpch-instantiate-templates %s -o %t
5 // RUN: %clang_cc1 -std=c++2a -include-pch %t -verify %s
7 // expected-no-diagnostics
12 auto l1
= []<int I
>() constexpr -> int {
16 auto l2
= []<auto I
>() constexpr -> decltype(I
) {
20 auto l3
= []<class T
>(auto i
) constexpr -> T
{
24 auto l4
= []<template<class> class T
, class U
>(T
<U
>, auto i
) constexpr -> U
{
28 #else /*included pch*/
30 static_assert(l1
.operator()<5>() == 5);
31 static_assert(l1
.operator()<6>() == 6);
33 static_assert(l2
.operator()<7>() == 7);
34 static_assert(l2
.operator()<nullptr>() == nullptr);
36 static_assert(l3
.operator()<int>(8.4) == 8);
37 static_assert(l3
.operator()<int>(9.9) == 9);
40 struct DummyTemplate
{ };
42 static_assert(l4(DummyTemplate
<float>(), 12) == 12.0);
43 static_assert(l4(DummyTemplate
<int>(), 19.8) == 19);