Strange gxx-6 (mpicxx) errors: how to force g++-5 (mpicxx-5) in the Makefile?

Hi,
i have written a huge C++/mpi program that i use for work. Which I had no problem using and compiling until some days ago as i did a distribution upgrade on my openSUSE tumbleweed system.
Iit seems that this also updated my gcc compiler from gcc-5 to gcc-6.
My program has a mode for single processing (compiled with g++) and one for multi processing (compiled with mpicxx).
Since the update i get some weird errors like this when i try to compile:

class_index.cpp: In member function ‘short int IndexRestrictionHandler::add(IndexRestriction*, short int, Summation*)’:
class_index.cpp:631:118: error: no match for ‘operator<<’ (operand types are ‘std::basic_ostream<char>’ and ‘std::ostream {aka std::basic_ostream<char>}’)
 eption: IndexRestrictionHandler::add(IndexRestriction*, short, Summation *)" << std::cout;
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
In file included from /usr/include/c++/6/iostream:39:0,
                 from class_index.cpp:1:
/usr/include/c++/6/ostream:628:5: note: candidate: std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&&, const _Tp&) [with _CharT = char; _Traits = std::char_traits<char>; _Tp = std::basic_ostream<char>] <near match>
     operator<<(basic_ostream<_CharT, _Traits>&& __os, const _Tp& __x)

or such errors

class_summation.cpp: In constructor ‘Summation::Summation(char*)’:
class_summation.cpp:51:5: error: this ‘else’ clause does not guard... -Werror=misleading-indentation]
     else
     ^~~~
class_summation.cpp:54:2: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘else’
  for (i=0; i<this->usedindicies; i++) {

I do not know whats wrong here, i hope it is just a bug in the compiler and it gets fixed soon. But i noticed that when i force the old gcc compiler like this:

make CC=g++-5

there is not error anymore.
But the problem is, that does not work for the multi processing version, i tried this:

make CC=mpicxx-5 mpi

but it just says that the compiler is not found.

I know that mpicxx is just a wrapper around g++ but, i am no expert and i just what to get this work but i have no glue.

Idealy there would be a solution to the g+±6 errors but if i can switch the compilers for now, i would be fine.

In another Forum thread, the GCC FAQ was referenced, describing how to run multiple installed GCC
https://gcc.gnu.org/faq.html#multiple

Good luck on that, I haven’t had an opportunity since that reference was posted to actually try either of the two methods (Likely the second since it should only require environmental path configuration. The first involves recompilation).

TSU

gcc/g++ version 6 is installed parallel to gcc/g++ version 5 on openSUSE (at least on tumbleweed).
As i said i can use version 6 by typing g++ (or using it as CC in the Makefile) and i can explicitly use version 5 by typing g+±5 (or using it as CC in the Makefile).
But for my mpi program i need mpicxx, which is, i think so at least, only a wrapper around g++, but i do not know how to explicitly use version 5 on that.
Just adding -5 as prefix (mpicxx-5) does not work.

I haven’t used mpicxx,
But I took a spin through the MAN pages
https://www.open-mpi.org/doc/v1.8/man1/mpicxx.1.php

I don’t know how you’re calling mpicxx in your makefile, but I assume you’re re-using the command options and not modifying.

If so, I don’t know if it makes a difference but you might notice that the CC option is supposed to designate a regular C compiler while the CXX option is used to designate a C++ compiler.

TSU

Using CXX over CC does not make any difference in the makefile, actually i can skip the makefile part here.
I can type

g++-5 program.cpp

in the console
but i cannot type

mpicxx-5 programm.cpp

in the console, thats the problem.