http://llvm.org/bugs/show_bug.cgi?id=15574
Bug ID: 15574
Summary: incorrect compilation with -Os
Product: new-bugs
Version: 3.2
Hardware: PC
OS: Windows NT
Status: NEW
Severity: normal
Priority: P
Component: new bugs
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Classification: Unclassified
Created attachment 10230
--> http://llvm.org/bugs/attachment.cgi?id=10230&action=edit
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@virtualbuntu:~$ clang++ -std=c++11 -O min-example.cpp -o working
fred@virtualbuntu:~$ ./working
fred@virtualbuntu:~$ clang++ -std=c++11 -Os min-example.cpp -o buggy
fred@virtualbuntu:~$ ./buggy
terminate called after throwing an instance of 'int'
Aborted (core dumped)
fred@virtualbuntu:~$ clang++ -v
Ubuntu clang version 3.2-1~exp5ubuntu2 (tags/RELEASE_32/final) (based on LLVM
3.2)
Target: x86_64-pc-linux-gnu
Thread model: posix
fred@virtualbuntu:~$ cat min-example.cpp
#include <boost/optional.hpp>
struct Parent {
int one;
Parent() : one(1){}
void throwParent(const boost::optional<int>& arg) {
if (one == 1) {
throw 666;
} else {
notUsed(arg);
}
}
virtual void notUsed( const boost::optional<int>& arg) = 0;
};
struct Child : public Parent {
virtual void notUsed( const boost::optional<int>& arg) override {
}
void throwChild() {
throwParent(boost::none);
}
};
int main(){
try {
Child().throwChild();
} catch( int ) {
return 0;
}
}
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs