Silence -Wunused-variable in release builds.
[llvm/stm8.git] / test / FrontendC++ / weak-external.cpp
blobf4f0ba19ef3736b95a8a62d553fb5590ce072f98
1 // RUN: %llvmgxx %s -S -O2 -o - | not grep {_ZNSs12_S_constructIPKcEEPcT_S3_RKSaIcESt20forward_iterator_tag}
2 // PR4262
4 // The "basic_string" extern template instantiation declaration is supposed to
5 // suppress the implicit instantiation of non-inline member functions. Make sure
6 // that we suppress the implicit instantiation of non-inline member functions
7 // defined out-of-line. That we aren't instantiating the basic_string
8 // constructor when we shouldn't be. Such an instantiation forces the implicit
9 // instantiation of _S_construct<const char*>. Since _S_construct is a member
10 // template, it's instantiation is *not* suppressed (despite being in
11 // basic_string<char>), so we would emit it as a weak definition.
13 #include <stdexcept>
15 void dummysymbol() {
16 throw(std::runtime_error("string"));