call.c (implicit_conversion): Check BRACE_ENCLOSED_INITIALIZER_P before forcing insta...
authorJason Merrill <jason@redhat.com>
Mon, 12 Sep 2011 18:04:23 +0000 (14:04 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Mon, 12 Sep 2011 18:04:23 +0000 (14:04 -0400)
* call.c (implicit_conversion): Check BRACE_ENCLOSED_INITIALIZER_P
before forcing instantiation.

From-SVN: r178786

gcc/cp/ChangeLog
gcc/cp/call.c

index 9fbbbee9caf8ac7a1851a3ad393376c28374da5a..0d5ccde887a11bfc3b1f9987510c945a9797255a 100644 (file)
@@ -1,3 +1,8 @@
+2011-09-09  Jason Merrill  <jason@redhat.com>
+
+       * call.c (implicit_conversion): Check BRACE_ENCLOSED_INITIALIZER_P
+       before forcing instantiation.
+
 2011-09-08  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/50324
index c707d663e245cd8a374523654288ccabcb675be0..62bee2da480d43b57eb9a77c1bb09986322576b2 100644 (file)
@@ -1848,8 +1848,8 @@ implicit_conversion (tree to, tree from, tree expr, bool c_cast_p,
                                |LOOKUP_NO_NARROWING));
 
       if (CLASS_TYPE_P (to)
-         && !CLASSTYPE_NON_AGGREGATE (complete_type (to))
-         && BRACE_ENCLOSED_INITIALIZER_P (expr))
+         && BRACE_ENCLOSED_INITIALIZER_P (expr)
+         && !CLASSTYPE_NON_AGGREGATE (complete_type (to)))
        return build_aggr_conv (to, expr, flags);
 
       cand = build_user_type_conversion_1 (to, expr, convflags);