https://llvm.org/bugs/show_bug.cgi?id=26216
Bug ID: 26216
Summary: compiling w -fno-exceptions generates errors on
"throw" in templates that are never instantiated
Product: clang
Version: trunk
Hardware: Macintosh
OS: All
Status: NEW
Severity: normal
Priority: P
Component: C++
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected]
Classification: Unclassified
I ran into this in the libc++ test suite.
If -fno-exceptions is defined, the following code compiles w/o error using GCC,
but gets an error with clang.
My expectation matches gcc's behavior; no error should be generated
unless/until the template is instantiated.
Reproducer:
#include <iostream>
#include <stdexcept>
template <typename T>
struct wrap {
wrap() : t_() {}
wrap(const T& t) : t_(t) {}
T & get() { return t_; }
void toss () { throw std::runtime_error("Toss"); }
T t_;
};
int main() {
std::cout << "Hello World" << std::endl;
}
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs