[PATCH] D79798: [flang] Constraint checks C751 to C760

Peter Klausler via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 12 13:59:52 PDT 2020


klausler requested changes to this revision.
klausler added inline comments.
This revision now requires changes to proceed.


================
Comment at: flang/lib/Semantics/check-declarations.cpp:157
 void CheckHelper::Check(const Symbol &symbol) {
+  // xmark
   if (context_.HasError(symbol)) {
----------------
?


================
Comment at: flang/lib/Semantics/check-declarations.cpp:288
   }
+  if (symbol.owner().IsDerivedType()) {
+    if (symbol.attrs().test(Attr::CONTIGUOUS) &&
----------------
Why two `if` statements?


================
Comment at: flang/lib/Semantics/resolve-names.cpp:3909
 }
-void DeclarationVisitor::Post(const parser::ProcComponentDefStmt &) {
+void DeclarationVisitor::Post(const parser::ProcComponentDefStmt &stmt) {
+  const auto &attrList{
----------------
Can't this constraint be checked in `check-declarations.cpp`?  If so, keep it out of name resolution.


================
Comment at: flang/lib/Semantics/resolve-names.cpp:3915
+    if (std::get_if<parser::Pointer>(&attr.u)) {
+      foundPointer = true;
+    }
----------------
Just `return` here, and remove the Boolean.


================
Comment at: flang/test/Semantics/resolve33.f90:43
     !ERROR: Must be a constant value
+    !ERROR: Invalid specification expression: derived type component not allowed to reference variable 'l'
     character(kind=k, len=l) :: d3
----------------
This error seems spurious to me.  We know that `l` (lower-case letter ell) is a type parameter.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79798/new/

https://reviews.llvm.org/D79798





More information about the llvm-commits mailing list