[flang] merge with master, add comments
authorpeter klausler <pklausler@nvidia.com>
Thu, 23 Aug 2018 22:28:08 +0000 (15:28 -0700)
committerpeter klausler <pklausler@nvidia.com>
Wed, 12 Sep 2018 23:29:02 +0000 (16:29 -0700)
Original-commit: flang-compiler/f18@1fe4cf81428fd63fe17671edf0071046a509e791
Reviewed-on: https://github.com/flang-compiler/f18/pull/183
Tree-same-pre-rewrite: false

flang/documentation/f2018-grammar.txt
flang/lib/common/fortran.h
flang/lib/parser/parse-tree.h

index af7ccf3..d3fbbca 100644 (file)
@@ -452,7 +452,7 @@ R1107 block-construct ->
         block-stmt [block-specification-part] block end-block-stmt
 R1108 block-stmt -> [block-construct-name :] BLOCK
 R1109 block-specification-part ->
-        [use-stmt]... [import-stmt]... [implicit-part]
+        [use-stmt]... [import-stmt]...
         [[declaration-construct]... specification-construct]
 R1110 end-block-stmt -> END BLOCK [block-construct-name]
 R1111 change-team-construct -> change-team-stmt block end-change-team-stmt
index 4b2a8fa..695d04b 100644 (file)
@@ -25,10 +25,6 @@ namespace Fortran::common {
 // Fortran has five kinds of intrinsic data, and the derived types.
 ENUM_CLASS(TypeCategory, Integer, Real, Complex, Character, Logical, Derived)
 
-static constexpr bool IsNumeric(TypeCategory cat) {
-  return cat <= TypeCategory::Complex;
-}
-
 // Kinds of IMPORT statements. Default means IMPORT or IMPORT :: names.
 ENUM_CLASS(ImportKind, Default, Only, None, All)
 
index 7fe0335..2580a5d 100644 (file)
@@ -2070,9 +2070,13 @@ WRAPPER_CLASS(BlockStmt, std::optional<Name>);
 WRAPPER_CLASS(EndBlockStmt, std::optional<Name>);
 
 // R1109 block-specification-part ->
-//         [use-stmt]... [import-stmt]... [implicit-part]
+//         [use-stmt]... [import-stmt]...
 //         [[declaration-construct]... specification-construct]
 WRAPPER_CLASS(BlockSpecificationPart, SpecificationPart);
+// TODO: Because BlockSpecificationPart just wraps the more general
+// SpecificationPart, it can misrecognize an ImplicitPart as part of
+// the BlockSpecificationPart during parsing, and we have to detect and
+// flag such usage in semantics.
 // TODO: error if any COMMON, EQUIVALENCE, INTENT, NAMELIST, OPTIONAL,
 // VALUE, ENTRY, SAVE /common/, or statement function definition statement
 // appears in a block-specification part (C1107, C1570).