Skip to content

Instantly share code, notes, and snippets.

@jefftrull
Created February 20, 2013 00:21
Show Gist options
  • Save jefftrull/4991577 to your computer and use it in GitHub Desktop.
Save jefftrull/4991577 to your computer and use it in GitHub Desktop.
Test case for gcc 4.7.2 crash ("internal compiler error: in get_expr_operands, at tree-ssa-operands.c:1035")
// A test case for gcc 4.7.2 crash
// Author: Jeff Trull <[email protected]>
#include <vector>
#include <algorithm>
template<class Base>
class MyClass : Base
{
public:
template<typename InIter>
void addValues(InIter beg, InIter const& end)
{
std::vector<float> values;
std::transform(beg, end,
std::back_inserter<std::vector<float> >(values),
[this](typename InIter::value_type const& v) { return inter_value(v); });
}
private:
template<typename Value>
Value inter_value(Value v)
{
return v; // performs no translation
}
};
class Empty
{
};
typedef MyClass<Empty> EmptyBase;
int main()
{
EmptyBase ww;
std::vector<float> valueset;
ww.addValues(valueset.begin(), valueset.end());
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment