From 222e2a7620e6520ffaf4fc4e69d79c18da31542e Mon Sep 17 00:00:00 2001 From: "Zancanaro; Carlo" Date: Mon, 24 Sep 2012 09:58:17 +1000 Subject: Add the clang library to the repo (with some of my changes, too). --- .../CXX/expr/expr.prim/expr.prim.lambda/p18.cpp | 45 ++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 clang/test/CXX/expr/expr.prim/expr.prim.lambda/p18.cpp (limited to 'clang/test/CXX/expr/expr.prim/expr.prim.lambda/p18.cpp') diff --git a/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p18.cpp b/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p18.cpp new file mode 100644 index 0000000..930a4b3 --- /dev/null +++ b/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p18.cpp @@ -0,0 +1,45 @@ +// RUN: %clang_cc1 -std=c++11 %s -Wunused -verify + +template +struct is_same { + static const bool value = false; +}; + +template +struct is_same { + static const bool value = true; +}; + +void f3() { + float x, &r = x; + int i; + int &ir = i; + const int &irc = i; + + [=,&irc,&ir] { + static_assert(is_same::value, + "should be const float&"); + static_assert(is_same::value, "should be float"); + static_assert(is_same::value, + "should be const float&"); + static_assert(is_same::value, "should be float&"); + static_assert(is_same::value, "should be int&"); + static_assert(is_same::value, "should be int&"); + static_assert(is_same::value, + "should be const int&"); + static_assert(is_same::value, + "should be const int&"); + }(); + + [=] { + [=] () mutable { + static_assert(is_same::value, "should be float"); + static_assert(is_same::value, + "should be float&"); + }(); + }(); + + [&i] { + static_assert(is_same::value, "should be int&"); + }(); +} -- cgit v1.2.3