g++-7.3.0 -std=c++17 gives an internal compiler error
g++-7.3.0 -std=c++14 works
g++-6.4.0 -std=c++17 works
g++-6.4.0 -std=c++14 works
Steps to Reproduce:
1. $ g++-7.3.0 -std=c++17 -c -o ouch.o ice.cpp
2. $ g++-7.3.0 -std=c++17 -c -o ouch.o ice2.cpp
3. $ g++-7.3.0 -std=c++17 -c -o ouch.o ice3.cpp
ice3.cpp: In function ‘void __static_initialization_and_destruction_0(int, int)’:
ice3.cpp:9:16: internal compiler error: in gimplify_expr, at gimplify.c:12200
d<3, float> j(1);
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://bugs.gentoo.org/> for instructions.
No internal compiler errors.
Reduced with creduce.
ice.cpp only gives an internal compiler error with the "# 7 "/usr/include/glm/gtc/quaternion.hpp" 3" line, and correctly gives sensible error messages without it. It's probably invalid C++, but compiles fine with g++-6.4.0 and/or -std=c++14.
ice2.cpp is probably valid C++.
ice3.cpp is a manually-reduced version of ice2.cpp.
Created attachment 537528 [details]
ice.cpp (creduce with grep 'quaternion.*internal compiler error')
Created attachment 537530 [details]
ice2.cpp (creduce with grep 'internal compiler error')
Created attachment 537532 [details]
ice3.cpp (manually reduced ice2.cpp)
Fails here as well on g++-7.3.0. g++-8.1.0 seems to survive just fine.
Filed bug upstream as https://gcc.gnu.org/PR86353
Upstream is not comfortabe backporting the fix to gcc-7.
I'm afraid you'll need to work it around on package level.