3 # Math/Functor.h uses std::auto_ptr, which triggers a warning
5 # Usage: MathFunctor_wrapper_test.sh [include directories]
9 ### BEGIN POSIX COMPLIANT ####
10 # Ubuntu 16 insists in using a non-bash default shell, and ctest insists to use the default shell;
11 # this horrible hack saves the day while issue #17234 is being addressed.
12 if [ -z "$BASH_VERSION" ] && [ "$1" != 'shellSwitch' ]
14 echo "Attempting to switch to bash."
15 bash -- "$0" 'shellSwitch' "$@"
18 [ "$1" = 'shellSwitch' ] && shift # here bash would be ok...
19 ### END POSIX COMPILANT ######
22 declare -a IncludeDirectives
24 IncludeDirectives=( "${IncludeDirectives[@]}" "-I${Dir}" )
27 Cmd=( g++ -std='c++14' -Wall -Werror=deprecated-declarations -pedantic "${IncludeDirectives[@]}" -x'c++' -c )
29 ===============================================================================
31 ===============================================================================
34 #include "Math/Functor.h"
38 -------------------------------------------------------------------------------
39 EXIT CODE: ${res} (errors are expected in the compilation above)
41 if [[ $res == 0 ]]; then
42 echo "Unexpected success in compiling 'Math/Functor.h'. May be time for dropping its wrapper." >&2
46 # this should work instead:
48 ===============================================================================
50 ===============================================================================
52 Cmd=( g++ -std='c++14' -Wall -Werror=deprecated-declarations -pedantic "${IncludeDirectives[@]}" -x'c++' -c )
54 #include "larcorealg/CoreUtils/quiet_Math_Functor.h"
58 -------------------------------------------------------------------------------
59 EXIT CODE: ${res} (errors are NOT expected in the compilation above)
60 ===============================================================================