Test: int_overflow.cpp int_overflow.cpp: In member function 'int PriceCalculator::calculateTotal(int, int)': int_overflow.cpp:8:25: error: expected '<' before '&' token 8 | if ((static_cast<long long>(pricePerUnit) * static_cast<long long>(quantity)) > static_cast<long long>(std::numeric_limits<int>::max())) | ^ int_overflow.cpp:8:25: error: expected type-specifier before '&' token int_overflow.cpp:8:25: error: expected '>' before '&' token int_overflow.cpp:8:25: error: expected '(' before '&' token int_overflow.cpp:8:26: error: 'lt' was not declared in this scope 8 | if ((static_cast<long long>(pricePerUnit) * static_cast<long long>(quantity)) > static_cast<long long>(std::numeric_limits<int>::max())) | ^~ int_overflow.cpp:8:28: error: expected ')' before ';' token 8 | if ((static_cast<long long>(pricePerUnit) * static_cast<long long>(quantity)) > static_cast<long long>(std::numeric_limits<int>::max())) | ^ int_overflow.cpp:8:28: error: expected ')' before ';' token int_overflow.cpp:8:13: note: to match this '(' 8 | if ((static_cast<long long>(pricePerUnit) * static_cast<long long>(quantity)) > static_cast<long long>(std::numeric_limits<int>::max())) | ^ int_overflow.cpp:8:28: error: expected ')' before ';' token 8 | if ((static_cast<long long>(pricePerUnit) * static_cast<long long>(quantity)) > static_cast<long long>(std::numeric_limits<int>::max())) | ^ int_overflow.cpp:8:12: note: to match this '(' 8 | if ((static_cast<long long>(pricePerUnit) * static_cast<long long>(quantity)) > static_cast<long long>(std::numeric_limits<int>::max())) | ^ int_overflow.cpp:8:39: error: 'gt' declared as reference but not initialized 8 | if ((static_cast<long long>(pricePerUnit) * static_cast<long long>(quantity)) > static_cast<long long>(std::numeric_limits<int>::max())) | ^~ int_overflow.cpp:8:70: error: expected '<' before '&' token 8 | if ((static_cast<long long>(pricePerUnit) * static_cast<long long>(quantity)) > static_cast<long long>(std::numeric_limits<int>::max())) | ^ int_overflow.cpp:8:70: error: expected type-specifier before '&' token int_overflow.cpp:8:70: error: expected '>' before '&' token int_overflow.cpp:8:70: error: expected '(' before '&' token int_overflow.cpp:8:71: error: 'lt' was not declared in this scope; did you mean 'gt'? 8 | if ((static_cast<long long>(pricePerUnit) * static_cast<long long>(quantity)) > static_cast<long long>(std::numeric_limits<int>::max())) | ^~ | gt int_overflow.cpp:8:73: error: expected ')' before ';' token 8 | if ((static_cast<long long>(pricePerUnit) * static_cast<long long>(quantity)) > static_cast<long long>(std::numeric_limits<int>::max())) | ^ int_overflow.cpp:8:84: error: redeclaration of 'long long int& gt' 8 | if ((static_cast<long long>(pricePerUnit) * static_cast<long long>(quantity)) > static_cast<long long>(std::numeric_limits<int>::max())) | ^~ int_overflow.cpp:8:39: note: 'long long int& gt' previously declared here 8 | if ((static_cast<long long>(pricePerUnit) * static_cast<long long>(quantity)) > static_cast<long long>(std::numeric_limits<int>::max())) | ^~ int_overflow.cpp:8:97: error: expected ';' before ')' token 8 | if ((static_cast<long long>(pricePerUnit) * static_cast<long long>(quantity)) > static_cast<long long>(std::numeric_limits<int>::max())) | ^ int_overflow.cpp:8:115: error: expected '<' before '&' token 8 | if ((static_cast<long long>(pricePerUnit) * static_cast<long long>(quantity)) > static_cast<long long>(std::numeric_limits<int>::max())) | ^ int_overflow.cpp:8:115: error: expected type-specifier before '&' token int_overflow.cpp:8:115: error: expected '>' before '&' token int_overflow.cpp:8:115: error: expected '(' before '&' token int_overflow.cpp:8:118: error: expected ')' before ';' token 8 | if ((static_cast<long long>(pricePerUnit) * static_cast<long long>(quantity)) > static_cast<long long>(std::numeric_limits<int>::max())) | ^ int_overflow.cpp:8:129: error: redeclaration of 'long long int& gt' 8 | if ((static_cast<long long>(pricePerUnit) * static_cast<long long>(quantity)) > static_cast<long long>(std::numeric_limits<int>::max())) | ^~ int_overflow.cpp:8:39: note: 'long long int& gt' previously declared here 8 | if ((static_cast<long long>(pricePerUnit) * static_cast<long long>(quantity)) > static_cast<long long>(std::numeric_limits<int>::max())) | ^~ int_overflow.cpp:8:138: error: 'numeric_limits' is not a member of 'std' 8 | if ((static_cast<long long>(pricePerUnit) * static_cast<long long>(quantity)) > static_cast<long long>(std::numeric_limits<int>::max())) | ^~~~~~~~~~~~~~ int_overflow.cpp:8:155: error: expected ')' before ';' token 8 | if ((static_cast<long long>(pricePerUnit) * static_cast<long long>(quantity)) > static_cast<long long>(std::numeric_limits<int>::max())) | ^ int_overflow.cpp:8:132: note: to match this '(' 8 | if ((static_cast<long long>(pricePerUnit) * static_cast<long long>(quantity)) > static_cast<long long>(std::numeric_limits<int>::max())) | ^ int_overflow.cpp:8:160: error: conflicting declaration 'int& gt' 8 | if ((static_cast<long long>(pricePerUnit) * static_cast<long long>(quantity)) > static_cast<long long>(std::numeric_limits<int>::max())) | ^~ int_overflow.cpp:8:39: note: previous declaration as 'long long int& gt' 8 | if ((static_cast<long long>(pricePerUnit) * static_cast<long long>(quantity)) > static_cast<long long>(std::numeric_limits<int>::max())) | ^~ int_overflow.cpp:8:165: error: '::max' has not been declared; did you mean 'std::max'? 8 | if ((static_cast<long long>(pricePerUnit) * static_cast<long long>(quantity)) > static_cast<long long>(std::numeric_limits<int>::max())) | ^~~ | std::max In file included from /usr/local/include/c++/13.4.0/string:51, from /usr/local/include/c++/13.4.0/bits/locale_classes.h:40, from /usr/local/include/c++/13.4.0/bits/ios_base.h:41, from /usr/local/include/c++/13.4.0/ios:44, from /usr/local/include/c++/13.4.0/ostream:40, from /usr/local/include/c++/13.4.0/iostream:41, from int_overflow.cpp:1: /usr/local/include/c++/13.4.0/bits/stl_algobase.h:303:5: note: 'std::max' declared here 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ int_overflow.cpp:9:39: error: conflicting declaration 'int& gt' 9 | return std::numeric_limits<int>::max(); | ^~ int_overflow.cpp:8:39: note: previous declaration as 'long long int& gt' 8 | if ((static_cast<long long>(pricePerUnit) * static_cast<long long>(quantity)) > static_cast<long long>(std::numeric_limits<int>::max())) | ^~ int_overflow.cpp:9:44: error: '::max' has not been declared; did you mean 'std::max'? 9 | return std::numeric_limits<int>::max(); | ^~~ | std::max /usr/local/include/c++/13.4.0/bits/stl_algobase.h:303:5: note: 'std::max' declared here 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ int_overflow.cpp:10:1: error: 'else' without a previous 'if' 10 | else | ^~~~