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