#include <memory>
template<typename T>
using CallbackPtr = const std::shared_ptr<const T>;
template<typename C, typename T>
using CallbackFunPtr = void (C::*)(CallbackPtr<T>);
int main () {
return 0;
}
results in:
7 : internal compiler error: Segmentation fault
Please submit a full bug report, with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.7/README.Bugs> for instructions.
Compilation failed
Am I doing something outside of the C++ standard here and G++ doesn’t have an error message yet? Or is this a true compiler bug?
Your code is fine, it’s a compiler bug. You might want to find the smallest test case and report it. On my copy of gcc-4.7.1, this
is sufficient to give me an ICE. The culprit is the
consthere. Your example compiles when defining CallbackPtr as