Skip to content
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

Relax the implementation of constraint C1302. #805

Merged
merged 6 commits into from Nov 5, 2019
Merged

Conversation

vdonaldson
Copy link
Collaborator

When a format item list can be unambiguously partitioned into individual
items even though one or more otherwise required comma separators are omitted,
generate a warning rather than an error.

When a format item list can be unambiguously partitioned into individual
items even though one or more otherwise required comma separators are omitted,
generate a warning rather than an error.
When a format item list can be unambiguously partitioned into individual
items even though one or more otherwise required comma separators are omitted,
generate a warning rather than an error.

Fixes #703
@@ -102,6 +102,30 @@ template<typename CHAR = char> class FormatValidator {
String, // char-literal-constant or Hollerith constant
};

bool mayHaveLeadingInt(TokenKind desc) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is basically a set membership test; consider using EnumSet.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it is. Doesn't EnumSet bring C++ library requirements with it?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whether a dependence on the binary C++ runtime support library is created probably depends on what parts of EnumSet one uses. I think you have a chance to just depend on things that are implemented in the standard headers in this case.

@@ -102,6 +102,30 @@ template<typename CHAR = char> class FormatValidator {
String, // char-literal-constant or Hollerith constant
};

bool mayHaveLeadingInt(TokenKind desc) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This member function should be marked static or (better, if possible) static constexpr.

Copy link
Collaborator

@psteinfeld psteinfeld left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything builds, tests, and looks correct to me.

Merge branch 'master' of github.com:flang-compiler/f18 into vkd-io13
Merge branch 'master' of github.com:flang-compiler/f18 into vkd-io13
Copy link
Collaborator

@jeanPerier jeanPerier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, I can still build this with g++ and link it to a C program without libstdc++.

@vdonaldson vdonaldson merged commit 79c0731 into master Nov 5, 2019
@vdonaldson vdonaldson deleted the vkd-io13 branch November 5, 2019 20:48
peterwaller-arm pushed a commit to peterwaller-arm/f18 that referenced this pull request Dec 5, 2019
* Relax the implementation of constraint C1302.

When a list of format items can be unambiguously partitioned into individual items even though one or more otherwise required comma separators are omitted, generate a warning rather than an error.

Fixes flang-compiler#703
swift-ci pushed a commit to apple/llvm-project that referenced this pull request Apr 9, 2020
…/f18#805)

* Relax the implementation of constraint C1302.

When a list of format items can be unambiguously partitioned into individual items even though one or more otherwise required comma separators are omitted, generate a warning rather than an error.

Fixes flang-compiler/f18#703

Original-commit: flang-compiler/f18@79c0731
Reviewed-on: flang-compiler/f18#805
mem-frob pushed a commit to draperlaboratory/hope-llvm-project that referenced this pull request Oct 7, 2022
…/f18#805)

* Relax the implementation of constraint C1302.

When a list of format items can be unambiguously partitioned into individual items even though one or more otherwise required comma separators are omitted, generate a warning rather than an error.

Fixes flang-compiler/f18#703

Original-commit: flang-compiler/f18@79c0731
Reviewed-on: flang-compiler/f18#805
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants