In C++0x mode, the following program:
--------------------
#include <stdexcept>
#include <system_error>
int main()
{
throw std::invalid_argument("foo");
}
--------------------
fails to compile, as:
error: 'invalid_argument' cannot be used as a function
The problem is that <system_error> introduces invalid_argument as
an enum value, and the enum is wrongly declared in namespace std,
hence clashes with std::invalid_argument from <stdexcept>.
--
Summary: [C++0x] namespace posix_error is mising
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: sylvain dot pion at sophia dot inria dot fr
GCC host triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34597