From d684a2cb96d2fad05504fb2f251ca51fc69f0232 Mon Sep 17 00:00:00 2001 From: Daniel Donenfeld Date: Wed, 27 Feb 2019 15:48:18 -0800 Subject: [PATCH] change compile only span test by adding new function to test ASM generation system --- tests/span_compile_only.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/tests/span_compile_only.cpp b/tests/span_compile_only.cpp index 5c9da6d..05356dd 100644 --- a/tests/span_compile_only.cpp +++ b/tests/span_compile_only.cpp @@ -28,7 +28,7 @@ // #include // for ptrdiff_t // #include // for string // #include // for integral_constant<>::value, is_default_co... -// #include // for vector +#include // for vector namespace gsl { struct fail_fast; @@ -54,3 +54,17 @@ bool foo() return ret; } } + + +GSL_SUPPRESS(con.4) // NO-FORMAT: attribute +bool bar() +{ + { + bool ret = true; + vector v{0,1,2,3}; + span s{v}; + ret = ret || (s.size() == 4 && s.data() != nullptr); + + return ret; + } +} \ No newline at end of file