]> granicus.if.org Git - clang/commitdiff
[Sema] Fix build with GCC
authorBenjamin Kramer <benny.kra@googlemail.com>
Mon, 1 Jan 2018 17:07:23 +0000 (17:07 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Mon, 1 Jan 2018 17:07:23 +0000 (17:07 +0000)
tools/clang/lib/Sema/DeclSpec.cpp: In member function 'void clang::DeclSpec::Finish(clang::Sema&, const clang::PrintingPolicy&)':
tools/clang/lib/Sema/DeclSpec.cpp:1116:8: error: could not convert 'clang::DeclSpec::TSW_unspecified' from 'const TSW {aka const clang::TypeSpecifierWidth}' to 'int'
tools/clang/lib/Sema/DeclSpec.cpp:1117:8: error: could not convert 'clang::DeclSpec::TSW_short' from 'const TSW {aka const clang::TypeSpecifierWidth}' to 'int'
tools/clang/lib/Sema/DeclSpec.cpp:1118:8: error: could not convert 'clang::DeclSpec::TSW_longlong' from 'const TSW {aka const clang::TypeSpecifierWidth}' to 'int'
tools/clang/lib/Sema/DeclSpec.cpp:1128:8: error: could not convert 'clang::DeclSpec::TSW_long' from 'const TSW {aka const clang::TypeSpecifierWidth}' to 'int'

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

lib/Sema/DeclSpec.cpp

index c76d94e7d800267f39bbd950c9918d31e5db6cce..460e7722c10272227768689b1058e872c42e9c31 100644 (file)
@@ -1112,7 +1112,7 @@ void DeclSpec::Finish(Sema &S, const PrintingPolicy &Policy) {
   }
 
   // Validate the width of the type.
-  switch (TypeSpecWidth) {
+  switch (static_cast<TypeSpecifierWidth>(TypeSpecWidth)) {
   case TSW_unspecified: break;
   case TSW_short:    // short int
   case TSW_longlong: // long long int