libc++ does not throw exceptions as expected
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
libc++ (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Tried compiling a very simple c++ program:
#include <string>
#include <iostream>
int main()
{
try
{
std::string x;
char z = x.at(2);
std::cout << z << std::endl;
}
catch (...)
{
}
return 0;
}
clang++ -stdlib=libc++ -Wall -Werror ./temp.cpp -o output
When run, it asserts:
./output
output: ../../libcxx/
[1] 27852 abort (core dumped) ./output
Expected behaviour is no assert, and program just returns. (This is the behaviour if -stdlib=libc++ is omitted).
I believe this is similar to https:/
ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: libc++-dev 3.7.0-1 [modified: usr/include/
ProcVersionSign
Uname: Linux 4.4.0-22-generic x86_64
ApportVersion: 2.20.1-0ubuntu2
Architecture: amd64
Date: Fri May 27 10:50:06 2016
Dependencies:
gcc-6-base 6.0.1-0ubuntu1
libc++-helpers 3.7.0-1
libc++1 3.7.0-1
libc6 2.23-0ubuntu3
libgcc1 1:6.0.1-0ubuntu1
InstallationDate: Installed on 2015-05-06 (386 days ago)
InstallationMedia: Ubuntu 15.04 "Vivid Vervet" - Release amd64 (20150422)
SourcePackage: libc++
UpgradeStatus: Upgraded to xenial on 2016-05-26 (0 days ago)
Status changed to 'Confirmed' because the bug affects multiple users.