llvm-project/clang/test
Faisal Vali d2598e97a4 Fix linkage calculation of auto member functions returning lambdas
As described by Richard in https://groups.google.com/a/isocpp.org/d/msg/std-discussion/S1kmj0wF5-g/fb6agEYoL2IJ

we should allow:

template<typename S>
struct A {

template<typename T> static auto default_lambda() {
  return [](const T&) { return 42; };
}

template<class U = decltype(default_lambda<S>())>
  U func(U u = default_lambda<S>()) { return u; }

};

int run2 = A<double>{}.func()(3.14);

int run3 = A<char>{}.func()('a');

This patch allows the code using the same trickery that was used to allow the code in non-member functions at namespace scope.


Please see http://llvm-reviews.chandlerc.com/D1844 for richard's approval.

llvm-svn: 192166
2013-10-08 04:15:04 +00:00
..
ARCMT ObjectiveC migrator: A typical implementation of 2013-10-07 20:41:53 +00:00
ASTMerge Changes so that a few tests do not fail when running under guarded malloc. 2013-07-12 22:30:03 +00:00
Analysis [analyzer] RetainCountChecker: add support for CFAutorelease. 2013-10-07 17:16:52 +00:00
CXX Add a triple to unbreak buildbots where size_t is not 'unsigned long'. 2013-10-07 22:58:25 +00:00
CodeCompletion Fix FileCheck --check-prefix lines. 2013-08-12 12:51:05 +00:00
CodeGen TBAA: use the same format for scalar TBAA and struct-path aware TBAA. 2013-10-08 00:08:49 +00:00
CodeGenCUDA CHECK-LABEL-ify some code gen tests to improve diagnostic experience when tests fail. 2013-08-15 06:47:53 +00:00
CodeGenCXX Fix linkage calculation of auto member functions returning lambdas 2013-10-08 04:15:04 +00:00
CodeGenObjC Replace -fobjc-default-synthesize-properties with disable-objc-default-synthesize-properties. 2013-09-27 20:21:48 +00:00
CodeGenObjCXX Fix ObjC @encode for C++ classes w/virtual bases. 2013-09-18 01:59:16 +00:00
CodeGenOpenCL Certain multi-platform languages, such as OpenCL, have the concept of 2013-09-13 12:04:22 +00:00
Coverage
Driver Revert r191947. The problem is not MIPS-specific and requires more 2013-10-04 11:46:54 +00:00
FixIt Fix a bug in the typo correction replacement location. 2013-09-26 19:10:34 +00:00
Format Allow _clang-format as alternative to .clang-format config filename 2013-09-10 15:41:12 +00:00
Frontend clang/test/Frontend/rewrite-includes.c: Tweak expressions for r'\\', not r'\', on win32. 2013-08-29 16:11:17 +00:00
Headers Switch tests in test/Headers to use %clang_cc1 rather than %clang. There 2013-09-20 21:12:25 +00:00
Index [libclang] Add some tests by Loïc Jaquemet that I forgot to add earlier. 2013-10-07 16:38:40 +00:00
Lexer Mark lambda init-captures as complete. 2013-09-28 04:37:56 +00:00
Misc clang-cl: print diagnostics as "error(clang): foo" in /fallback mode 2013-09-24 00:08:55 +00:00
Modules When merging class definitions across modules in C++, merge together fields. 2013-10-07 08:02:11 +00:00
OpenMP [OpenMP] Added parsing and semantic analysis for firstprivate clause 2013-10-01 05:32:34 +00:00
PCH Add compat/extension warnings for init captures. 2013-09-28 05:38:27 +00:00
Parser Add compat/extension warnings for init captures. 2013-09-28 05:38:27 +00:00
Preprocessor Add support for -mcx16, and predefine __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16 when 2013-10-05 20:14:27 +00:00
Rewriter ObjectiveC modern rewriter. Rewrite typedefs 2013-10-07 19:54:22 +00:00
Sema Split test to test -Wshadow with emmintrin.h more portable. 2013-10-08 00:03:41 +00:00
SemaCUDA
SemaCXX Sema: Only merge typedef attributes if the previous decl is a typedef 2013-10-08 00:19:09 +00:00
SemaObjC ObjectiveC: Warn when 'readonly' property has explicit 2013-10-07 17:20:02 +00:00
SemaObjCXX Replace -fobjc-default-synthesize-properties with disable-objc-default-synthesize-properties. 2013-09-27 20:21:48 +00:00
SemaOpenCL Removing the endian attribute and updating associated test cases. This functionality was never completely implemented, and this is an improvement over silently eating the attribute. 2013-09-09 12:57:20 +00:00
SemaTemplate Variable templates: handle instantiation of static data member templates 2013-09-27 20:14:12 +00:00
TableGen
Tooling Fixed replacements for files with relative paths are not applied. 2013-10-01 14:59:00 +00:00
Unit [tests] Update to use lit_config and lit package, as appropriate. 2013-08-09 14:43:04 +00:00
CMakeLists.txt Re-add clang-format tests to clang/test. 2013-03-25 09:14:25 +00:00
Makefile Make the information about disabled ARCMT/Rewriter/StaticAnalyzer available 2013-08-27 19:27:35 +00:00
TestRunner.sh
cxx-sections.data
lit.cfg Add "native" to config.available_features, to make it easier to disable non-x-compile-safe tests 2013-09-13 11:02:31 +00:00
lit.site.cfg.in Add "native" to config.available_features, to make it easier to disable non-x-compile-safe tests 2013-09-13 11:02:31 +00:00
make_test_dirs.pl