-
Notifications
You must be signed in to change notification settings - Fork 1.5k
fixed #13743 - FP AssignmentAddressToInteger for double cast #7417
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -475,6 +475,8 @@ class TestTokenizer : public TestFixture { | |
|
||
TEST_CASE(atomicCast); // #12605 | ||
TEST_CASE(constFunctionPtrTypedef); // #12135 | ||
|
||
TEST_CASE(simplifyPlatformTypes); | ||
} | ||
|
||
#define tokenizeAndStringify(...) tokenizeAndStringify_(__FILE__, __LINE__, __VA_ARGS__) | ||
|
@@ -8495,6 +8497,24 @@ class TestTokenizer : public TestFixture { | |
ASSERT_NO_THROW(tokenizeAndStringify(code)); | ||
ASSERT_EQUALS("void ( * const f ) ( ) ;", tokenizeAndStringify("typedef void (*fp_t)(); fp_t const f;")); | ||
} | ||
|
||
void simplifyPlatformTypes() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't these tests go here? #7416 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. They used to be there but I included them here to have more coverage of the various parts of the code which triggered the issue. |
||
{ | ||
const char code[] = "size_t f();"; | ||
ASSERT_EQUALS("unsigned long f ( ) ;", tokenizeAndStringify(code, true, Platform::Type::Unix32)); | ||
ASSERT_EQUALS("unsigned long f ( ) ;", tokenizeAndStringify(code, true, Platform::Type::Unix64)); | ||
} | ||
{ | ||
const char code[] = "ssize_t f();"; | ||
ASSERT_EQUALS("long f ( ) ;", tokenizeAndStringify(code, true, Platform::Type::Unix32)); | ||
ASSERT_EQUALS("long f ( ) ;", tokenizeAndStringify(code, true, Platform::Type::Unix64)); | ||
} | ||
{ | ||
const char code[] = "std::ptrdiff_t f();"; | ||
ASSERT_EQUALS("long f ( ) ;", tokenizeAndStringify(code, true, Platform::Type::Unix32)); | ||
ASSERT_EQUALS("long f ( ) ;", tokenizeAndStringify(code, true, Platform::Type::Unix64)); | ||
} | ||
} | ||
}; | ||
|
||
REGISTER_TEST(TestTokenizer) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
str()
clears the varid so this test was pointless.