PR c++/47703
* error.c (location_of): Handle non-tagged types.
From-SVN: r170349
2011-02-20 Jason Merrill <jason@redhat.com>
+ PR c++/47703
+ * error.c (location_of): Handle non-tagged types.
+
PR c++/46472
* method.c (process_subob_fn): Instantiate constexpr templates.
* optimize.c (maybe_clone_body): Propagate DECL_DECLARED_CONSTEXPR_P.
if (TREE_CODE (t) == PARM_DECL && DECL_CONTEXT (t))
t = DECL_CONTEXT (t);
else if (TYPE_P (t))
- t = TYPE_MAIN_DECL (t);
+ {
+ t = TYPE_MAIN_DECL (t);
+ if (t == NULL_TREE)
+ return input_location;
+ }
else if (TREE_CODE (t) == OVERLOAD)
t = OVL_FUNCTION (t);
2011-02-20 Jason Merrill <jason@redhat.com>
+ * g++.dg/overload/conv-op1.C: New.
+
* g++.dg/cpp0x/constexpr-synth1.C: New.
2011-02-20 Nicola Pero <nicola.pero@meta-innovation.com>
--- /dev/null
+// PR c++/47703
+
+typedef void (*pfn)(int &);
+
+struct A
+{
+ operator pfn() { return 0; }
+};
+
+void f()
+{
+ const int i = 42;
+ A()(i); // { dg-message "<conversion>" }
+}
+
+// { dg-prune-output "no match" }
+// { dg-prune-output "candidate" }