1 // RUN: %clang_cc1 -std=c++2a -verify %s
3 template<typename
, typename
>
4 constexpr bool is_same
= false;
7 constexpr bool is_same
<T
, T
> = true;
10 struct DummyTemplate
{ };
13 auto L0
= []<typename T
>(T arg
) {
14 static_assert(is_same
<T
, int>); // expected-error {{static assertion failed}}
17 L0(0.0); // expected-note {{in instantiation}}
20 static_assert(I
== 5); // expected-error {{static assertion failed}}
23 L1
.operator()<6>(); // expected-note {{in instantiation}}
25 auto L2
= []<template<typename
> class T
, class U
>(T
<U
> &&arg
) {
26 static_assert(is_same
<T
<U
>, DummyTemplate
<float>>); // // expected-error {{static assertion failed}}
28 L2(DummyTemplate
<float>());
29 L2(DummyTemplate
<double>()); // expected-note {{in instantiation}}
32 template<typename T
> // expected-note {{declared here}}
35 auto L
= []<typename T
> { }; // expected-error {{'T' shadows template parameter}}
41 return []<T x
>() { return x
; }.template operator()<123>(); // expected-error {{no matching member function}} \
42 expected
-note
{{candidate
template ignored
}}
44 static_assert(outer
<int>() == 123);
45 template int *outer
<int *>(); // expected-note {{in instantiation}}