summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-01-12 20:47:01 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-01-17 13:48:27 (GMT)
commit69182ce4ed95c62d51e208c8620ff4e6599dee2e (patch)
tree5949932d4a1625697c42d8cb08bb892ebd4b509e
parent54156d723a3fde678ed7f884364ad0449d23ad2b (diff)
downloadCMake-69182ce4ed95c62d51e208c8620ff4e6599dee2e.zip
CMake-69182ce4ed95c62d51e208c8620ff4e6599dee2e.tar.gz
CMake-69182ce4ed95c62d51e208c8620ff4e6599dee2e.tar.bz2
Features: Ensure that the cxx_auto_type test is correct.
SolarisStudio considers 'auto' to be a storage class specifier in C++98 mode (as appropriate), and considers variables without a specified type to be of type int. So, it treats auto x = 3.14; as auto int x = 3.14; which in C++98 mode is equivalent to int x = 3.14; and it does not fail to compile as expected. Change the test to use a reference so that the type must be known.
-rw-r--r--Tests/CompileFeatures/cxx_auto_type.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/Tests/CompileFeatures/cxx_auto_type.cpp b/Tests/CompileFeatures/cxx_auto_type.cpp
index 7dbf04f..1f36a79 100644
--- a/Tests/CompileFeatures/cxx_auto_type.cpp
+++ b/Tests/CompileFeatures/cxx_auto_type.cpp
@@ -1,5 +1,12 @@
+double foo_ = 3.14;
+
+double& foo()
+{
+ return foo_;
+}
+
void someFunc()
{
- auto x = 3.14;
+ auto& x = foo();
}