stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject svn commit: r345383 - in /incubator/stdcxx/trunk/etc/config/src: FOR_LOCAL_SCOPE.cpp NO_FOR_LOCAL_SCOPE.cpp
Date Fri, 18 Nov 2005 00:20:13 GMT
Author: sebor
Date: Thu Nov 17 16:20:10 2005
New Revision: 345383

URL: http://svn.apache.org/viewcvs?rev=345383&view=rev
Log:
2005-11-17  Martin Sebor  <sebor@roguewave.com>

	* FOR_LOCAL_SCOPE.cpp: Deleted an unreliable test (some compilers,
	such as gcc 2 or Intel C++ 8 on Windows) only issue a warning but
	do not actually reject the test.
	* NO_FOR_LOCAL_SCOPE.cpp: Implemented the same functionality as
	above but as a negative test, i.e., one which is considered passing
	on failure to compile.

Added:
    incubator/stdcxx/trunk/etc/config/src/NO_FOR_LOCAL_SCOPE.cpp   (with props)
Removed:
    incubator/stdcxx/trunk/etc/config/src/FOR_LOCAL_SCOPE.cpp

Added: incubator/stdcxx/trunk/etc/config/src/NO_FOR_LOCAL_SCOPE.cpp
URL: http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/etc/config/src/NO_FOR_LOCAL_SCOPE.cpp?rev=345383&view=auto
==============================================================================
--- incubator/stdcxx/trunk/etc/config/src/NO_FOR_LOCAL_SCOPE.cpp (added)
+++ incubator/stdcxx/trunk/etc/config/src/NO_FOR_LOCAL_SCOPE.cpp Thu Nov 17 16:20:10 2005
@@ -0,0 +1,18 @@
+// checking for scope of for-init-statements
+
+int foo (int n)
+{
+    int result = 0;
+
+    // 6.5.3, p3, the scope of `i' extends to the end of
+    // the for-statement (and not beyond)
+    for (int i = 0; i != n; ++i)
+        result += i;
+
+    // check to see if i is still in scope here
+    // if so, the test will compile succesfully
+    // indicating a failure
+    result *= i;
+
+    return result;
+}

Propchange: incubator/stdcxx/trunk/etc/config/src/NO_FOR_LOCAL_SCOPE.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/stdcxx/trunk/etc/config/src/NO_FOR_LOCAL_SCOPE.cpp
------------------------------------------------------------------------------
    svn:keywords = Id



Mime
View raw message