Work around MSVC's lack of support for unrestricted unions by making this
authorRichard Smith <richard-llvm@metafoo.co.uk>
Sat, 23 Jul 2016 02:39:52 +0000 (02:39 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Sat, 23 Jul 2016 02:39:52 +0000 (02:39 +0000)
struct a bit bigger under MSVC (this shouldn't be a big deal; we typically
allocate no more than two of these at a time, on the stack).

llvm-svn: 276509

clang/include/clang/Sema/DeclSpec.h

index d48a1c2..0c6514f 100644 (file)
@@ -1752,13 +1752,17 @@ private:
   /// \brief The asm label, if specified.
   Expr *AsmLabel;
 
+#ifndef _MSC_VER
   union {
+#endif
     /// InlineParams - This is a local array used for the first function decl
     /// chunk to avoid going to the heap for the common case when we have one
     /// function chunk in the declarator.
     DeclaratorChunk::ParamInfo InlineParams[16];
     DecompositionDeclarator::Binding InlineBindings[16];
+#ifndef _MSC_VER
   };
+#endif
 
   /// \brief If this is the second or subsequent declarator in this declaration,
   /// the location of the comma before this declarator.