* class.c (resolves_to_fixed_type_p): Check uses_template_parms
(current_function_decl) instead of processing_template_decl.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_7-branch@189189
138bc75d-0d04-0410-961f-
82ee72b054a4
2012-07-02 Jason Merrill <jason@redhat.com>
+ PR c++/53816
+ * class.c (resolves_to_fixed_type_p): Check uses_template_parms
+ (current_function_decl) instead of processing_template_decl.
+
PR c++/53821
* semantics.c (maybe_add_lambda_conv_op): Don't set
DECL_INTERFACE_KNOWN.
int cdtorp = 0;
tree fixed;
- if (processing_template_decl)
+ /* processing_template_decl can be false in a template if we're in
+ fold_non_dependent_expr, but we still want to suppress this check. */
+ if (processing_template_decl
+ || (current_function_decl
+ && uses_template_parms (current_function_decl)))
{
/* In a template we only care about the type of the result. */
if (nonnull)
2012-07-02 Jason Merrill <jason@redhat.com>
+ PR c++/53816
+ * g++.dg/template/ref6.C: New.
+
PR c++/53821
* g++.dg/cpp0x/lambda/lambda-template6.C: New.
--- /dev/null
+// PR c++/53816
+
+template <typename T>
+struct S { int v () const; };
+template <typename T>
+struct V : public S<T> {};
+struct U
+{
+ V<int> v;
+ template<typename T>
+ struct W
+ {
+ W (U const &x) { V<int> const &v = x.v; v.v(); }
+ };
+};