Test: int_overflow.cpp int_overflow.cpp: In member function 'int PriceCalculator::calculateTotal(int, int)': int_overflow.cpp:8:43: error: expected '<' before '&' token 8 | long long totalPrice = static_cast<long long>(pricePerUnit) * static_cast<long long>(quantity); | ^ int_overflow.cpp:8:43: error: expected type-specifier before '&' token int_overflow.cpp:8:43: error: expected '>' before '&' token int_overflow.cpp:8:43: error: expected '(' before '&' token int_overflow.cpp:8:44: error: 'lt' was not declared in this scope 8 | long long totalPrice = static_cast<long long>(pricePerUnit) * static_cast<long long>(quantity); | ^~ int_overflow.cpp:8:46: error: expected ')' before ';' token 8 | long long totalPrice = static_cast<long long>(pricePerUnit) * static_cast<long long>(quantity); | ^ int_overflow.cpp:8:57: error: 'gt' declared as reference but not initialized 8 | long long totalPrice = static_cast<long long>(pricePerUnit) * static_cast<long long>(quantity); | ^~ int_overflow.cpp:8:88: error: expected '<' before '&' token 8 | long long totalPrice = static_cast<long long>(pricePerUnit) * static_cast<long long>(quantity); | ^ int_overflow.cpp:8:88: error: expected type-specifier before '&' token int_overflow.cpp:8:88: error: expected '>' before '&' token int_overflow.cpp:8:88: error: expected '(' before '&' token int_overflow.cpp:8:91: error: expected ')' before ';' token 8 | long long totalPrice = static_cast<long long>(pricePerUnit) * static_cast<long long>(quantity); | ^ int_overflow.cpp:8:102: error: redeclaration of 'long long int& gt' 8 | long long totalPrice = static_cast<long long>(pricePerUnit) * static_cast<long long>(quantity); | ^~ int_overflow.cpp:8:57: note: 'long long int& gt' previously declared here 8 | long long totalPrice = static_cast<long long>(pricePerUnit) * static_cast<long long>(quantity); | ^~ int_overflow.cpp:9:32: error: expected '<' before '&' token 9 | if (totalPrice > static_cast<long long>(std::numeric_limits<int>::max())) { | ^ int_overflow.cpp:9:32: error: expected type-specifier before '&' token int_overflow.cpp:9:32: error: expected '>' before '&' token int_overflow.cpp:9:32: error: expected '(' before '&' token int_overflow.cpp:9:35: error: expected ')' before ';' token 9 | if (totalPrice > static_cast<long long>(std::numeric_limits<int>::max())) { | ^ int_overflow.cpp:9:35: error: expected ')' before ';' token int_overflow.cpp:9:4: note: to match this '(' 9 | if (totalPrice > static_cast<long long>(std::numeric_limits<int>::max())) { | ^ int_overflow.cpp:9:46: error: redeclaration of 'long long int& gt' 9 | if (totalPrice > static_cast<long long>(std::numeric_limits<int>::max())) { | ^~ int_overflow.cpp:8:57: note: 'long long int& gt' previously declared here 8 | long long totalPrice = static_cast<long long>(pricePerUnit) * static_cast<long long>(quantity); | ^~ int_overflow.cpp:9:55: error: 'numeric_limits' is not a member of 'std' 9 | if (totalPrice > static_cast<long long>(std::numeric_limits<int>::max())) { | ^~~~~~~~~~~~~~ int_overflow.cpp:9:72: error: expected ')' before ';' token 9 | if (totalPrice > static_cast<long long>(std::numeric_limits<int>::max())) { | ^ int_overflow.cpp:9:49: note: to match this '(' 9 | if (totalPrice > static_cast<long long>(std::numeric_limits<int>::max())) { | ^ int_overflow.cpp:9:77: error: conflicting declaration 'int& gt' 9 | if (totalPrice > static_cast<long long>(std::numeric_limits<int>::max())) { | ^~ int_overflow.cpp:8:57: note: previous declaration as 'long long int& gt' 8 | long long totalPrice = static_cast<long long>(pricePerUnit) * static_cast<long long>(quantity); | ^~ int_overflow.cpp:9:82: error: '::max' has not been declared; did you mean 'std::max'? 9 | if (totalPrice > 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:12:19: error: expected '<' before '&' token 12 | return static_cast<int>(totalPrice); // Can overflow! | ^ int_overflow.cpp:12:19: error: expected type-specifier before '&' token int_overflow.cpp:12:19: error: expected '>' before '&' token int_overflow.cpp:12:19: error: expected '(' before '&' token int_overflow.cpp:12:22: error: expected ')' before ';' token 12 | return static_cast<int>(totalPrice); // Can overflow! | ^ int_overflow.cpp:12:27: error: conflicting declaration 'int& gt' 12 | return static_cast<int>(totalPrice); // Can overflow! | ^~ int_overflow.cpp:8:57: note: previous declaration as 'long long int& gt' 8 | long long totalPrice = static_cast<long long>(pricePerUnit) * static_cast<long long>(quantity); | ^~