https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67807
Bug ID: 67807 Summary: call to public member function catalog failed on Linux -std=c++03 Product: gcc Version: 5.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: chanhmy.lieu at oracle dot com Target Milestone: --- Created attachment 36435 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36435&action=edit Testcase to show problem Problem: call to public member function catalog failed on Linux -std=c++03 or -std=c++11 using g++/5.1.0. Same exercise passed with g++/4.9.2. % cat t.c #include <locale> #include <string> #include <stdio.h> template <class charT> class D : public std::messages<charT> { public: D() {}; std::messages_base::catalog func00(const std::basic_string<char>& name, const std::locale& loc) { return std::messages<charT>::do_open(name, loc); }; typename std::messages<charT>::string_type func02(std::messages_base::catalog cat, int set, int msgid, const typename std::messages<charT>::string_type& dfault) { return std::messages<charT>::do_get(cat, set, msgid, dfault); }; }; int main() { D<char> dchar; const std::basic_string<char> name; const std::locale loc00; int n1 = dchar.open(name, loc00); int n2 = dchar.func00(name, loc00); if (n1 != n2) printf("Failed: n1 = %d, n2 = %d\n", n1, n2); else printf("Passed: n1 = %d, n2 = %d\n", n1, n2); } #----------------------------------------------- + /net/dv104/export/tools/gcc/5.1.0/intel-Linux/bin/g++ t.c + rc=0 return code from g++: 0 a.out Failed: n1 = 0, n2 = 1 #----------------------------------------------------- Test passed with gcc/4.9.2: /net/dv103/export/tools/gcc/4.9.2/intel-Linux/bin/g++ t.c return code from g++: 0 a.out Passed: n1 = 0, n2 = 0