[cfe-commits] r56134 - /cfe/trunk/lib/Parse/ParseStmt.cpp

Argiris Kirtzidis akyrtzi at gmail.com
Thu Sep 11 16:08:39 PDT 2008


Author: akirtzidis
Date: Thu Sep 11 18:08:39 2008
New Revision: 56134

URL: http://llvm.org/viewvc/llvm-project?rev=56134&view=rev
Log:
Add comments about C++ clause 3.3.2p4 that mentions that the condition declaration should be local to an if/switch/while/for statement.

Modified:
    cfe/trunk/lib/Parse/ParseStmt.cpp

Modified: cfe/trunk/lib/Parse/ParseStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseStmt.cpp?rev=56134&r1=56133&r2=56134&view=diff

==============================================================================
--- cfe/trunk/lib/Parse/ParseStmt.cpp (original)
+++ cfe/trunk/lib/Parse/ParseStmt.cpp Thu Sep 11 18:08:39 2008
@@ -439,6 +439,10 @@
   // A name introduced by a declaration in a condition is in scope from its
   // point of declaration until the end of the substatements controlled by the
   // condition.
+  // C++ 3.3.2p4:
+  // Names declared in the for-init-statement, and in the condition of if,
+  // while, for, and switch statements are local to the if, while, for, or
+  // switch statement (including the controlled statement).
   //
   if (C99orCXX)
     EnterScope(Scope::DeclScope | Scope::ControlScope);
@@ -563,6 +567,10 @@
   // A name introduced by a declaration in a condition is in scope from its
   // point of declaration until the end of the substatements controlled by the
   // condition.
+  // C++ 3.3.2p4:
+  // Names declared in the for-init-statement, and in the condition of if,
+  // while, for, and switch statements are local to the if, while, for, or
+  // switch statement (including the controlled statement).
   //
   if (C99orCXX)
     EnterScope(Scope::BreakScope | Scope::DeclScope | Scope::ControlScope);
@@ -640,6 +648,10 @@
   // A name introduced by a declaration in a condition is in scope from its
   // point of declaration until the end of the substatements controlled by the
   // condition.
+  // C++ 3.3.2p4:
+  // Names declared in the for-init-statement, and in the condition of if,
+  // while, for, and switch statements are local to the if, while, for, or
+  // switch statement (including the controlled statement).
   //
   if (C99orCXX)
     EnterScope(Scope::BreakScope | Scope::ContinueScope |
@@ -775,6 +787,10 @@
   // A name introduced by a declaration in a condition is in scope from its
   // point of declaration until the end of the substatements controlled by the
   // condition.
+  // C++ 3.3.2p4:
+  // Names declared in the for-init-statement, and in the condition of if,
+  // while, for, and switch statements are local to the if, while, for, or
+  // switch statement (including the controlled statement).
   // C++ 6.5.3p1:
   // Names declared in the for-init-statement are in the same declarative-region
   // as those declared in the condition.





More information about the cfe-commits mailing list