From 1543986483795764fb27f77bdf417b8b86cbef12 Mon Sep 17 00:00:00 2001 From: Faisal Vali Date: Sun, 31 Jul 2016 01:19:17 +0000 Subject: [PATCH] [NFC] Rearrange an example-file so the c++14 specific example is on top. This makes it easier to add C++1z examples to the bottom, just before the #endif. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@277287 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/SemaCXX/cxx1z-constexpr-lambdas.cpp | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/test/SemaCXX/cxx1z-constexpr-lambdas.cpp b/test/SemaCXX/cxx1z-constexpr-lambdas.cpp index 610d814443..526dd27d9d 100644 --- a/test/SemaCXX/cxx1z-constexpr-lambdas.cpp +++ b/test/SemaCXX/cxx1z-constexpr-lambdas.cpp @@ -2,6 +2,17 @@ // RUN: %clang_cc1 -std=c++1z -verify -fsyntax-only -fblocks -fdelayed-template-parsing %s // RUN: %clang_cc1 -std=c++14 -verify -fsyntax-only -fblocks %s -DCPP14_AND_EARLIER + +namespace test_lambda_is_literal { +#ifdef CPP14_AND_EARLIER +//expected-error@+4{{not a literal type}} +//expected-note@+2{{not an aggregate and has no constexpr constructors}} +#endif +auto L = [] { }; +constexpr int foo(decltype(L) l) { return 0; } + +} + #ifndef CPP14_AND_EARLIER namespace test_constexpr_checking { @@ -35,14 +46,5 @@ namespace ns3 { } // end ns test_constexpr_call -#endif - -namespace test_lambda_is_literal { -#ifdef CPP14_AND_EARLIER -//expected-error@+4{{not a literal type}} -//expected-note@+2{{not an aggregate and has no constexpr constructors}} -#endif -auto L = [] { }; -constexpr int foo(decltype(L) l) { return 0; } +#endif // ndef CPP14_AND_EARLIER -} \ No newline at end of file -- 2.40.0