]> granicus.if.org Git - clang/commitdiff
Add size to constexpr Arrays
authorErich Keane <erich.keane@intel.com>
Thu, 8 Feb 2018 23:49:40 +0000 (23:49 +0000)
committerErich Keane <erich.keane@intel.com>
Thu, 8 Feb 2018 23:49:40 +0000 (23:49 +0000)
What seems to be a bug in older versions of MSVC, constexpr
member arrays with a redefinition (to force emission) require
their initial definition to have the size between the brackets.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@324682 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Basic/Targets/AMDGPU.h

index 26d4c7f63684c5113de235c9e9bed70663ea068b..38794eef2b90e22d6bd1e3d86034aba872e79d3a 100644 (file)
@@ -69,7 +69,7 @@ class LLVM_LIBRARY_VISIBILITY AMDGPUTargetInfo final : public TargetInfo {
     AMDGPUTargetInfo::GPUKind Kind;
   };
 
-  static constexpr NameGPUKind R600Names[] = {
+  static constexpr NameGPUKind R600Names[25] = {
       {{"r600"}, GK_R600},
       {{"rv610"}, GK_R600},
       {{"rv620"}, GK_R600},
@@ -96,7 +96,7 @@ class LLVM_LIBRARY_VISIBILITY AMDGPUTargetInfo final : public TargetInfo {
       {{"cayman"}, GK_CAYMAN},
       {{"aruba"}, GK_CAYMAN},
   };
-  static constexpr NameGPUKind AMDGCNNames[] = {
+  static constexpr NameGPUKind AMDGCNNames[33] = {
       {{"gfx600"}, GK_GFX6},    {{"tahiti"}, GK_GFX6},
       {{"gfx601"}, GK_GFX6},    {{"pitcairn"}, GK_GFX6},
       {{"verde"}, GK_GFX6},     {{"oland"}, GK_GFX6},