I'm reviewing C++ code in the R project (http://www.r-project.org). R itself does not use C++ but many contributed packages do, and many of these rely on the Rcpp interface between R and C++ (https://github.com/RcppCore/Rcpp ). Solaris is one of the testing platforms for R packages (http://cran.r-project.org/web/checks/check_summary.html) and it will be extremely helpful to continue to use it as people move to C++11. I understand that support for C++11 in 12.4 is currently limited, but I would like to take the opportunity to highlight some problems. I've got two clearly identified problems so far, but there will be more.
The "using" keyword can only be used in a template definition, whereas it should also be possible to use it outside of a template as a general replacement for typedef.
using IntMap = std::map<int, T>;
using IntVector = std::vector<int>;
martyn@fimbo:~/temp$ CC -c -std=c++11 using.cc
"using.cc", line 9: Error: IntVector is not defined.
"using.cc", line 9: Error: Use ";" to terminate declarations.
"using.cc", line 9: Error: A declaration was expected instead of "=".
"using.cc", line 9: Warning: declarator required in declaration.
3 Error(s) and 1 Warning(s) detected.
Both clang++ and Intel Composer XE accept the second usage.
The compiler is sensitive to the order of the override and noexcept keywords. Putting them in the wrong order causes a syntax error.
virtual void method_a() const noexcept;
virtual void method_b() const noexcept;
class B : public A
virtual void method_a() const override noexcept; //OK
virtual void method_b() const noexcept override; //Not OK!
martyn@fimbo:~/temp$ CC -c -std=c++11 override.cc
"override.cc", line 12: Error: "," expected instead of "override".
1 Error(s) detected.
Clang++ allows both orderings. The Intel C++ compiler rejects the order "override noexcept" and accepts the order "noaccept override" which is unfortunately the exact opposite of what Solaris Studio 12.4beta accepts.