PR c++/79290
* typeck.c (build_ptrmemfunc_access_expr): Set TREE_NO_WARNING.
PR c++/79290
* g++.dg/warn/pr79290.C: New.
From-SVN: r245069
2017-01-31 Nathan Sidwell <nathan@acm.org>
+ PR c++/79290
+ * typeck.c (build_ptrmemfunc_access_expr): Set TREE_NO_WARNING.
+
PR c++/67273
PR c++/79253
* pt.c: (instantiate_decl): Push to top level when current
member = DECL_CHAIN (member))
if (DECL_NAME (member) == member_name)
break;
- return build_simple_component_ref (ptrmem, member);
+ tree res = build_simple_component_ref (ptrmem, member);
+
+ TREE_NO_WARNING (res) = 1;
+ return res;
}
/* Given an expression PTR for a pointer, return an expression
2017-01-31 Nathan Sidwell <nathan@acm.org>
+ PR c++/79290
+ * g++.dg/warn/pr79290.C: New.
+
PR c++/67273
PR c++/79253
* g++.dg/cpp1y/pr67273.C: New.
--- /dev/null
+// { dg-additional-options "-Wall" }
+// PR 79290, bogus warning looking inside PMF
+
+struct Song {
+ int get() const ;
+};
+
+typedef int (Song::*PMF_t)() const;
+
+struct SongTag {
+ PMF_t function () const;
+};
+
+
+template<typename T>
+struct Printer {
+ bool Foo(const SongTag &st) {
+ return st.function () == &Song::get;
+ }
+};
+
+void Baz (Printer<int> *p, SongTag const &st)
+{
+ p->Foo (st);
+}