Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 9 Feb 2014 20:52:48 +0000 (UTC)
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r261680 - head/contrib/llvm/tools/clang/lib/Sema
Message-ID:  <201402092052.s19KqmjN020085@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dim
Date: Sun Feb  9 20:52:47 2014
New Revision: 261680
URL: http://svnweb.freebsd.org/changeset/base/261680

Log:
  Pull in r200899 from upstream clang trunk:
  
    Allow transformation of VariableArray to ConstantArray.
  
    In the following code:
  
       struct A { static const int sz; };
       template<class T> void f() { T arr[A::sz]; }
  
    the array 'arr' is represented as a variable size array in the template.
    If 'A::sz' gets value below in the translation unit, the array in
    instantiation can turn into constant size array.
  
    This change fixes PR18633.
  
    Differential Revision: http://llvm-reviews.chandlerc.com/D2688
  
  This fixes "Assertion failed: (T::isKind(*this)), function castAs"
  errors, which can occur when building the security/quantis port.
  
  Reported by:	ale
  MFC after:	3 days

Modified:
  head/contrib/llvm/tools/clang/lib/Sema/TreeTransform.h

Modified: head/contrib/llvm/tools/clang/lib/Sema/TreeTransform.h
==============================================================================
--- head/contrib/llvm/tools/clang/lib/Sema/TreeTransform.h	Sun Feb  9 20:32:27 2014	(r261679)
+++ head/contrib/llvm/tools/clang/lib/Sema/TreeTransform.h	Sun Feb  9 20:52:47 2014	(r261680)
@@ -3837,7 +3837,9 @@ TreeTransform<Derived>::TransformVariabl
       return QualType();
   }
 
-  VariableArrayTypeLoc NewTL = TLB.push<VariableArrayTypeLoc>(Result);
+  // We might have constant size array now, but fortunately it has the same
+  // location layout.
+  ArrayTypeLoc NewTL = TLB.push<ArrayTypeLoc>(Result);
   NewTL.setLBracketLoc(TL.getLBracketLoc());
   NewTL.setRBracketLoc(TL.getRBracketLoc());
   NewTL.setSizeExpr(Size);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201402092052.s19KqmjN020085>