Destructor call in a comma-separated expression
问题 consider the following example program: #include <iostream> using namespace std; struct t { ~t() {cout << "destroyed\n"; } }; int main() { cout << "test\n"; t(), cout << "doing stuff\n"; cout << "end\n"; } The output I get with GCC 4.9.2 is: test doing stuff destroyed end cpp.sh link: http://cpp.sh/3cvm However according to cppreference about the comma operator: In a comma expression E1, E2, the expression E1 is evaluated, its result is discarded, and its side effects are completed before