]> granicus.if.org Git - clang/commitdiff
make TryFixInvalidVariablyModifiedType a static function.
authorChris Lattner <sabre@nondot.org>
Wed, 12 Nov 2008 21:17:48 +0000 (21:17 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 12 Nov 2008 21:17:48 +0000 (21:17 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59163 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/Sema.h
lib/Sema/SemaDecl.cpp

index 5b66694e045dfe58cff0efe71ef1b42b00bed284..6a86a8ab78da4a3821c84cf9f94e056ceb9744bb 100644 (file)
@@ -1307,11 +1307,6 @@ public:
 
   void InitBuiltinVaListType();
 
-  // Helper method to turn variable array types into
-  // constant array types in certain situations which would otherwise
-  // be errors
-  QualType TryFixInvalidVariablyModifiedType(QualType T);
-  
   //===--------------------------------------------------------------------===//
   // Extra semantic analysis beyond the C type system
 private:
index bab55bf8293c8c1c63ec88d9a7e907da6951be67..1a85bf46868c8180de3fd079ea2522931d9015a2 100644 (file)
@@ -2477,7 +2477,11 @@ void Sema::ActOnDefs(Scope *S, SourceLocation DeclStart,
   CollectIvars(Class, Context, Decls);
 }
 
-QualType Sema::TryFixInvalidVariablyModifiedType(QualType T) {
+/// TryToFixInvalidVariablyModifiedType - Helper method to turn variable array
+/// types into constant array types in certain situations which would otherwise
+/// be errors (for GCC compatibility).
+static QualType TryToFixInvalidVariablyModifiedType(QualType T,
+                                                    ASTContext &Context) {
   // This method tries to turn a variable array into a constant
   // array even when the size isn't an ICE.  This is necessary
   // for compatibility with code that depends on gcc's buggy
@@ -2532,7 +2536,7 @@ Sema::DeclTy *Sema::ActOnField(Scope *S,
   // C99 6.7.2.1p8: A member of a structure or union may have any type other
   // than a variably modified type.
   if (T->isVariablyModifiedType()) {
-    QualType FixedTy = TryFixInvalidVariablyModifiedType(T);
+    QualType FixedTy = TryToFixInvalidVariablyModifiedType(T, Context);
     if (!FixedTy.isNull()) {
       Diag(Loc, diag::warn_illegal_constant_array_size, Loc);
       T = FixedTy;