diff options
Diffstat (limited to 'test/SemaCXX/vartemplate-lambda.cpp')
-rw-r--r-- | test/SemaCXX/vartemplate-lambda.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/SemaCXX/vartemplate-lambda.cpp b/test/SemaCXX/vartemplate-lambda.cpp new file mode 100644 index 000000000000..9dab6da3d1e3 --- /dev/null +++ b/test/SemaCXX/vartemplate-lambda.cpp @@ -0,0 +1,18 @@ +// RUN: %clang_cc1 -std=c++14 -fsyntax-only -verify %s +// expected-no-diagnostics + +template <class> auto fn0 = [] {}; +template <typename> void foo0() { fn0<char>(); } + +template<typename T> auto fn1 = [](auto a) { return a + T(1); }; + +template <typename X> +int foo2() { + X a = 0x61; + fn1<char>(a); + return 0; +} + +int main() { + foo2<int>(); +} |