This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PING] Re: Add const char* constructors for exception classes in <stdexcept>


On 26/01/14 15:15 +0100, Oleg Endo wrote:
Files in libstdc++-v3/src/c++98/ seem to be never compiled with C++11.
Thus I can think of two options:
1) Add const char* ctors for C++98 and C++11.
2) Add #ifdef'ed declarations to libstdc++-v3/include/std/stdexcept and
add a new file libstdc++-v3/src/c++11/stdexcept.cc with the
implementations.

3) Move stdexcept.cc from src/c++98 to src/c++11
4) Define the functions inline using forwarding constructors, which
   means we don't need new exports.

The attached patch does 1).

I don't think we want the constructors in C++03 mode though, it could
break some valid programs e.g. a custom string type with implicit
conversion to const char* and std::string can be passed to an exception
constructor in C++03, but adding the overloads would make it
ambiguous.

I think I prefer option 4, it avoids adding new exports during Stage 3
(although the patch was initially posted during Stage 1, it is now
quite late to add new exports, which is not your fault but still a
concern.)



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]