Skip to content

Commit f59657f

Browse files
committed
add test
1 parent b067f37 commit f59657f

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

test/testtokenize.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,8 @@ class TestTokenizer : public TestFixture {
305305
TEST_CASE(bitfields16); // Save bitfield bit count
306306
TEST_CASE(bitfields17);
307307
TEST_CASE(bitfields18);
308+
TEST_CASE(bitfields19); // ticket #13733
309+
TEST_CASE(bitfields20);
308310

309311
TEST_CASE(simplifyNamespaceStd);
310312

@@ -4858,6 +4860,16 @@ class TestTokenizer : public TestFixture {
48584860
ASSERT_EQUALS("[test.cpp:1:29]: (warning) Bit-field size exceeds max number of bits 32767 [tooLargeBitField]\n", errout_str());
48594861
}
48604862

4863+
void bitfields19() {
4864+
const char code[] = "struct S { volatile std::uint32_t a : 10; };";
4865+
ASSERT_EQUALS("struct S { volatile std :: uint32_t a ; } ;", tokenizeAndStringify(code));
4866+
}
4867+
4868+
void bitfields20() {
4869+
const char code[] = "struct S { volatile ::uint32_t a : 10; };";
4870+
ASSERT_EQUALS("struct S { volatile :: uint32_t a ; } ;", tokenizeAndStringify(code));
4871+
}
4872+
48614873
void simplifyNamespaceStd() {
48624874
const char *expected;
48634875

0 commit comments

Comments
 (0)