The following code works in gcc versions 2.9-4.4, but not version 4.5:
struct Pass {
};
int main(void){
Pass **passes = new ( Pass (*[ 10 ]) );
}
Specific error message with gcc 4.5:
prob.cc: In function ‘int main()’:
prob.cc:6:31: warning: lambda expressions only available with -std=c++0x or -std=gnu++0x
prob.cc:6:38: error: no matching function for call to ‘Pass::Pass(void (&)())’
prob.cc:2:1: note: candidates are: Pass::Pass()
prob.cc:2:1: note: Pass::Pass(const Pass&)
Adding the requested flag ignores the initial warning, but does not fix the problem. Can someone explain how to fix this? This is from some obscure part of the C ++ code that I support, and I only know a limited amount of C ++.
source
share