* call.c (implicit_conversion): Check BRACE_ENCLOSED_INITIALIZER_P
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 12 Sep 2011 18:04:23 +0000 (18:04 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 12 Sep 2011 18:04:23 +0000 (18:04 +0000)
before forcing instantiation.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@178786 138bc75d-0d04-0410-961f-82ee72b054a4

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

index 9fbbbee..0d5ccde 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 c707d66..62bee2d 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);