http://gcc.gnu.org/bugzilla/show_bug.cgi?id=61080
Bug ID: 61080 Summary: Spurious no return statement warning with deleted operators Product: gcc Version: 4.10.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: jamborm at gcc dot gnu.org CC: paolo.carlini at oracle dot com Since r210043 I'm getting the following warning which I believe is spurious: $ ~/gcc/small/inst/bin/g++ -Wall -Werror=return-type -fpermissive -fno-rtti -fno-exceptions -fno-math-errno -std=gnu++0x 2.C -S 2.C: In instantiation of ‘WeakMapPtr<K, V>& WeakMapPtr<K, V>::operator=(const WeakMapPtr<K, V>&) [with K = JSObject*; V = JSObject*]’: 2.C:32:16: required from here 2.C:16:17: error: no return statement in function returning non-void [-Werror=return-type] WeakMapPtr &operator=(const WeakMapPtr &wmp) = delete; ^ cc1plus: some warnings being treated as errors $ cat 2.C struct AAA { int a1, a2, a3; void *p; }; template <typename K, typename V> class WeakMapPtr { public: WeakMapPtr() : ptr(nullptr) {}; bool init(AAA *cx); private: void *ptr; WeakMapPtr(const WeakMapPtr &wmp) = delete; WeakMapPtr &operator=(const WeakMapPtr &wmp) = delete; }; template <typename K, typename V> bool WeakMapPtr<K, V>::init(AAA *cx) { ptr = cx->p; return true; } struct JSObject { int blah; float meh; }; template class WeakMapPtr<JSObject*, JSObject*>;