This website requires JavaScript.
Explore
Help
Sign In
kolan
/
CMake
Watch
1
Star
0
Fork
You've already forked CMake
0
Code
Issues
Pull Requests
Releases
Wiki
Activity
8de778118b
CMake
/
Tests
/
CompileFeatures
/
cxx_auto_type.cpp
13 lines
95 B
C++
Raw
Normal View
History
Unescape
Escape
Features: Add cxx_auto_type. Record the availability of this feature for GNU 4.8 on (UNIX AND NOT APPLE) only. In the future, availability can be recorded for earlier GNU, for other platforms and for other compilers. Initially the affected configurations are as restricted as possible to allow for easy testing while extending the features vector in only one dimension. The error message when using the set_property API directly is not very good, but follow up commits will provide origin debugging of the property and a target_compile_features command which will provide a configure-time backtrace when possible.
2014-04-02 17:34:16 +04:00
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.
2015-01-12 23:47:01 +03:00
double
foo_
=
3.14
;
double
&
foo
(
)
{
return
foo_
;
}
Features: Add cxx_auto_type. Record the availability of this feature for GNU 4.8 on (UNIX AND NOT APPLE) only. In the future, availability can be recorded for earlier GNU, for other platforms and for other compilers. Initially the affected configurations are as restricted as possible to allow for easy testing while extending the features vector in only one dimension. The error message when using the set_property API directly is not very good, but follow up commits will provide origin debugging of the property and a target_compile_features command which will provide a configure-time backtrace when possible.
2014-04-02 17:34:16 +04:00
void
someFunc
(
)
{
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.
2015-01-12 23:47:01 +03:00
auto
&
x
=
foo
(
)
;
Features: Add cxx_auto_type. Record the availability of this feature for GNU 4.8 on (UNIX AND NOT APPLE) only. In the future, availability can be recorded for earlier GNU, for other platforms and for other compilers. Initially the affected configurations are as restricted as possible to allow for easy testing while extending the features vector in only one dimension. The error message when using the set_property API directly is not very good, but follow up commits will provide origin debugging of the property and a target_compile_features command which will provide a configure-time backtrace when possible.
2014-04-02 17:34:16 +04:00
}