Test [[ and ]] in string literal are preserved

Suggested by wsfulton in #1158
This commit is contained in:
Olly Betts 2022-07-08 15:33:01 +12:00
commit 5ddcbac56b
2 changed files with 16 additions and 0 deletions

View file

@ -38,4 +38,6 @@ bool maybeUnused2(bool a, [[maybe_unused]] bool b) { return a; }
struct [[nodiscard]] S { };
const char *test_string_literal() { return "Test [[ and ]] in string literal"; }
%}

View file

@ -0,0 +1,14 @@
<?php
require "tests.php";
// New functions
check::functions(array('noReturn','noDiscard','noDiscardDeprecated','maybeUnused1','maybeUnused2','likely','test_string_literal'));
// New classes
check::classes(array('cpp11_attribute_specifiers','S'));
// No new vars
check::globals(array());
check::equal(test_string_literal(), 'Test [[ and ]] in string literal', "test_string_literal() wrong");
check::done();