Created
February 20, 2013 00:21
-
-
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")
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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