Skip to content
Snippets Groups Projects
Commit 6bbf986b authored by Christoph Grüninger's avatar Christoph Grüninger
Browse files

Reduce number of warnings.

nullptr-test.cc: Move semicolon to own line to prevent
Clang warning.
typetraitstest.cc: Exclude use of deprecated types
PointeeType and ReferredType with
DISABLE_DEPRECATED_METHOD_CHECKS defined.
parent fe8cb3dc
No related branches found
No related tags found
No related merge requests found
......@@ -16,16 +16,24 @@ void basic_tests()
++n;
#endif
int n2 = 0; // n2 is zero
if( ch == 0 ) ; // evaluates to true
if( ch == nullptr ) ; // evaluates to true
if( nullptr == ch ) ; // evaluates to true
if( ch ) ; // evaluates to false
if( n2 == 0 ) ; // evaluates to true
if( ch == 0 ) // evaluates to true
;
if( ch == nullptr ) // evaluates to true
;
if( nullptr == ch ) // evaluates to true
;
if( ch ) // evaluates to false
;
if( n2 == 0 ) // evaluates to true
;
ch = ch2;
#ifdef FAIL
if( n2 == nullptr ) ; // error
if( nullptr ) ; // error, no conversion to bool
if( nullptr == 0 ) ; // error
if( n2 == nullptr ) // error
;
if( nullptr ) // error, no conversion to bool
;
if( nullptr == 0 ) // error
;
// arithmetic
nullptr = 0; // error, nullptr is not an lvalue
nullptr + 2; // error
......
......@@ -26,6 +26,7 @@ int main() {
assert( Dune::TypeTraits<int&>::isReference );
assert( not Dune::TypeTraits<int&&>::isReference );
#ifndef DISABLE_DEPRECATED_METHOD_CHECKS
// Test TypeTraits::PointeeType
assert( (Dune::is_same<Dune::Empty, Dune::TypeTraits<int>::PointeeType>::value) );
assert( (Dune::is_same<int, Dune::TypeTraits<int*>::PointeeType>::value) );
......@@ -36,6 +37,7 @@ int main() {
// Test TypeTraits::ReferredType
assert( (Dune::is_same<int, Dune::TypeTraits<int>::ReferredType>::value) );
assert( (Dune::is_same<int, Dune::TypeTraits<int&>::ReferredType>::value) );
#endif // DISABLE_DEPRECATED_METHOD_CHECKS
// Test is_pointer
assert( not Dune::is_pointer<int>::value );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment