saghir created this revision.
saghir added reviewers: ABataev, kkwli0, RaviNarayanaswamy, mikerice, Hahnfeld, 
hfinkel, gtbercea.
saghir added a project: OpenMP.
Herald added subscribers: cfe-commits, guansong.

In ParseOpenMP.cpp:

bool ColonExpected = false;
...
...
...
else if (ColonExpected)

  Diag(Tok, diag::warn_pragma_expected_colon) << "map type";

The flag ColonExpected is not changed after being initialized to false at 
declaration. Hence, the code within the else if is never executed.

We should remove all instances of this flag.


Repository:
  rC Clang

https://reviews.llvm.org/D54958

Files:
  clang/lib/Parse/ParseOpenMP.cpp


Index: clang/lib/Parse/ParseOpenMP.cpp
===================================================================
--- clang/lib/Parse/ParseOpenMP.cpp
+++ clang/lib/Parse/ParseOpenMP.cpp
@@ -1867,7 +1867,6 @@
                   getOpenMPSimpleClauseType(Kind, PP.getSpelling(Tok)))
             : OMPC_MAP_unknown;
     Data.DepLinMapLoc = Tok.getLocation();
-    bool ColonExpected = false;
 
     if (IsMapClauseModifierToken(Tok)) {
       if (PP.LookAhead(0).is(tok::colon)) {
@@ -1935,8 +1934,6 @@
 
     if (Tok.is(tok::colon))
       Data.ColonLoc = ConsumeToken();
-    else if (ColonExpected)
-      Diag(Tok, diag::warn_pragma_expected_colon) << "map type";
   }
 
   bool IsComma =


Index: clang/lib/Parse/ParseOpenMP.cpp
===================================================================
--- clang/lib/Parse/ParseOpenMP.cpp
+++ clang/lib/Parse/ParseOpenMP.cpp
@@ -1867,7 +1867,6 @@
                   getOpenMPSimpleClauseType(Kind, PP.getSpelling(Tok)))
             : OMPC_MAP_unknown;
     Data.DepLinMapLoc = Tok.getLocation();
-    bool ColonExpected = false;
 
     if (IsMapClauseModifierToken(Tok)) {
       if (PP.LookAhead(0).is(tok::colon)) {
@@ -1935,8 +1934,6 @@
 
     if (Tok.is(tok::colon))
       Data.ColonLoc = ConsumeToken();
-    else if (ColonExpected)
-      Diag(Tok, diag::warn_pragma_expected_colon) << "map type";
   }
 
   bool IsComma =
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to