http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49252
Summary: Problem with inline Product: gcc Version: 4.6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassig...@gcc.gnu.org ReportedBy: jwillem...@remedy.nl Using gcc on OpenSuSE 4.6 g++-4.6 (SUSE Linux) 4.6.0 20110505 [gcc-4_6-branch revision 173419] Copyright (C) 2011 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. The example program: #include <string> namespace Demo { class SOne { std::string text (void) const; private: std::string text_; }; } inline std::string ::Demo::SOne::text (void) const { return this->text_; } Gives the error: johnny@m4500jw:~/ACE/IDL2CPP/test> g++-4.6 -fno-strict-aliasing -fvisibility=hidden -fvisibility-inlines-hidden -O3 -ggdb -m64 -pthread -Wall -W -Wpointer-arith -pipe -D_GNU_SOURCE -std=c++0x -c -o .obj/demoC.o a.cpp a.cpp:13:8: error: ‘Demo’ in class ‘std::string’ does not name a type Removing :: after std::string in the inline method resolves this error