From owner-svn-src-stable@FreeBSD.ORG Fri Aug 23 18:04:14 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 55A12C4C; Fri, 23 Aug 2013 18:04:14 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 287482804; Fri, 23 Aug 2013 18:04:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7NI4EYL096748; Fri, 23 Aug 2013 18:04:14 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7NI4Ew2096747; Fri, 23 Aug 2013 18:04:14 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201308231804.r7NI4Ew2096747@svn.freebsd.org> From: Dimitry Andric Date: Fri, 23 Aug 2013 18:04:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r254728 - stable/9/contrib/llvm/tools/clang/lib/Sema X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 18:04:14 -0000 Author: dim Date: Fri Aug 23 18:04:13 2013 New Revision: 254728 URL: http://svnweb.freebsd.org/changeset/base/254728 Log: MFC r254582: Pull in r182983 from upstream clang trunk: Fix handling of braced-init-list as reference initializer within aggregate initialization. Previously we would incorrectly require an extra set of braces around such initializers. Pull in r188718 from upstream clang trunk: Handle init lists and _Atomic fields. Fixes PR16931. These fixes are needed for the atomic_flag type to work correctly in our stdatomic.h. Requested by: theraven Modified: stable/9/contrib/llvm/tools/clang/lib/Sema/SemaInit.cpp Directory Properties: stable/9/contrib/llvm/ (props changed) stable/9/contrib/llvm/tools/clang/ (props changed) Modified: stable/9/contrib/llvm/tools/clang/lib/Sema/SemaInit.cpp ============================================================================== --- stable/9/contrib/llvm/tools/clang/lib/Sema/SemaInit.cpp Fri Aug 23 18:03:18 2013 (r254727) +++ stable/9/contrib/llvm/tools/clang/lib/Sema/SemaInit.cpp Fri Aug 23 18:04:13 2013 (r254728) @@ -774,6 +774,11 @@ void InitListChecker::CheckSubElementTyp InitListExpr *StructuredList, unsigned &StructuredIndex) { Expr *expr = IList->getInit(Index); + + if (ElemType->isReferenceType()) + return CheckReferenceType(Entity, IList, ElemType, Index, + StructuredList, StructuredIndex); + if (InitListExpr *SubInitList = dyn_cast(expr)) { if (!ElemType->isRecordType() || ElemType->isAggregateType()) { unsigned newIndex = 0; @@ -793,13 +798,13 @@ void InitListChecker::CheckSubElementTyp // C++ initialization is handled later. } - if (ElemType->isScalarType()) { + // FIXME: Need to handle atomic aggregate types with implicit init lists. + if (ElemType->isScalarType() || ElemType->isAtomicType()) return CheckScalarType(Entity, IList, ElemType, Index, StructuredList, StructuredIndex); - } else if (ElemType->isReferenceType()) { - return CheckReferenceType(Entity, IList, ElemType, Index, - StructuredList, StructuredIndex); - } + + assert((ElemType->isRecordType() || ElemType->isVectorType() || + ElemType->isArrayType()) && "Unexpected type"); if (const ArrayType *arrayType = SemaRef.Context.getAsArrayType(ElemType)) { // arrayType can be incomplete if we're initializing a flexible