-
Notifications
You must be signed in to change notification settings - Fork 274
Fix Bison grammar issues preventing us from parsing CoreFoundation #5438
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
Merged
hannes-steffenhagen-diffblue
merged 2 commits into
diffblue:develop
from
hannes-steffenhagen-diffblue:tmp/grammar-issues
Aug 3, 2020
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
typedef unsigned short USHORT; | ||
|
||
enum A : USHORT | ||
{ | ||
AV | ||
}; | ||
enum B : unsigned short | ||
{ | ||
BV | ||
}; | ||
enum C : signed long long | ||
{ | ||
CV | ||
}; | ||
|
||
int main(void) | ||
{ | ||
return 0; | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
CORE | ||
test.c | ||
|
||
^EXIT=0$ | ||
^SIGNAL=0$ | ||
-- | ||
^PARSING ERROR$ | ||
-- | ||
A previous attempt to allow underlying type specifications didn't allow typedef | ||
names or multi word types (e.g. unsigned int). We still don't actually fully | ||
apply the underlying type to the enum, but this at least lets us use parse code | ||
that uses this feature. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
inline int inline_function_with_postfix_attributes(void) | ||
__attribute__((not_a_real_attribute)) | ||
{ | ||
return 0; | ||
} | ||
|
||
int non_inline_with_postfix_attributes(void) | ||
__attribute__((not_a_real_attribute)) | ||
{ | ||
return 0; | ||
} | ||
|
||
int main(void) | ||
{ | ||
} |
11 changes: 11 additions & 0 deletions
11
regression/ansi-c/function_with_postfix_attributes/test.desc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
CORE gcc-only | ||
test.c | ||
|
||
^EXIT=0$ | ||
^SIGNAL=0$ | ||
-- | ||
^PARSING ERROR$ | ||
-- | ||
gcc doesn't support postfix attributes but clang does, and Apples CoreFoundation framework makes use of this for availability macros. | ||
|
||
Testing both the inline and non-inline variants because these are different cases in our parser. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
ℹ️ We probably want something like the following, in order to actually build the list -
I have added this ℹ️ comment as a note about future work which will likely be needed eventually. This is not a blocking comment.
Uh oh!
There was an error while loading. Please reload this page.
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.
For onlookers: actually fully supporting this feature is in the pipeline, just getting this. to parse is higher priority though so it comes first.