clang++ -Os compiles incorrectly
Bug #1159667 reported by
Gurg Hackpof
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
LLVM |
Fix Released
|
Medium
|
|||
clang (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Current raring (as of 24/03/2013) suffers of this clang++ bug (http://
affects: | ubuntu → clang (Ubuntu) |
Changed in llvm: | |
importance: | Unknown → Medium |
status: | Unknown → Fix Released |
To post a comment you must log in.
Created attachment 10230
output of clang -E min-example.cpp
Dear clang devs,
I hope this is the right place to post a bug report.
You'll find below a simple reproductible example for an incorrect compilation bug that shows up using -Os on clang 3.2-1 (from the latest ubuntu beta).
Boost is coming from libboost-dev 1.49.0.1 (also from the latest ubuntu beta)
Also, the output of "clang -E min-example.cpp" is attached to the bug report.
Thank you for making such a great product.
Yours Sincerely,
Gurg Hackpof
------- ------- ------- ------
fred@virtualbun tu:~$ clang++ -std=c++11 -O min-example.cpp -o working tu:~$ ./working tu:~$ clang++ -std=c++11 -Os min-example.cpp -o buggy tu:~$ ./buggy
fred@virtualbun
fred@virtualbun
fred@virtualbun
terminate called after throwing an instance of 'int'
Aborted (core dumped)
fred@virtualbun tu:~$ clang++ -v 32/final) (based on LLVM 3.2)
Ubuntu clang version 3.2-1~exp5ubuntu2 (tags/RELEASE_
Target: x86_64-pc-linux-gnu
Thread model: posix
fred@virtualbun tu:~$ cat min-example.cpp optional. hpp>
#include <boost/
struct Parent { optional< int>& arg) {
throw 666;
notUsed( arg); optional< int>& arg) = 0;
int one;
Parent() : one(1){}
void throwParent(const boost::
if (one == 1) {
} else {
}
}
virtual void notUsed( const boost::
};
struct Child : public Parent { optional< int>& arg) override {
throwParent( boost:: none);
virtual void notUsed( const boost::
}
void throwChild() {
}
};
int main(){
Child( ).throwChild( );
return 0;
try {
} catch( int ) {
}
}