C++: Fix parsing enum specifier III

This amends the obviously wrong
aac1bebace.

Fixes

  FAIL!  : tst_Semantic::q_enum_1() Compared values are not the same
  FAIL!  : tst_CheckSymbols::test_checksymbols(EnumerationUse) 'resultCount > 0' returned FALSE. ()
  FAIL!  : tst_CheckSymbols::test_checksymbols(VariableHasTheSameNameAsEnumUse) Compared values are not the same
  FAIL!  : tst_CheckSymbols::test_checksymbols(enum_inside_block_inside_function_QTCREATORBUG5456) Compared values are not the same
  FAIL!  : tst_CheckSymbols::test_checksymbols(enum_inside_function_QTCREATORBUG5456) Compared values are not the same

  FAIL!  : CppTools::Internal::CppToolsPlugin::test_completion(enum_inside_block_inside_function) Compared lists have different sizes.
  FAIL!  : CppTools::Internal::CppToolsPlugin::test_completion(enum_inside_block_inside_function_cxx11) Compared lists have different sizes.
  FAIL!  : CppTools::Internal::CppToolsPlugin::test_completion(enum_inside_function) Compared lists have different sizes.
  FAIL!  : CppTools::Internal::CppToolsPlugin::test_completion(enum_inside_function_cxx11) Compared lists have different sizes.
  FAIL!  : CppTools::Internal::CppToolsPlugin::test_completion(enum_inside_class) Compared lists have different sizes.
  FAIL!  : CppTools::Internal::CppToolsPlugin::test_completion(enum_inside_class_cxx11) Compared lists have different sizes.
  FAIL!  : CppTools::Internal::CppToolsPlugin::test_completion(enum_inside_namespace) Compared lists have different sizes.
  FAIL!  : CppTools::Internal::CppToolsPlugin::test_completion(enum_inside_namespace_cxx11) Compared lists have different sizes.
  FAIL!  : CppTools::Internal::CppToolsPlugin::test_completion(enum_inside_member_function) Compared lists have different sizes.
  FAIL!  : CppTools::Internal::CppToolsPlugin::test_completion(enum_inside_member_function_cxx11) Compared lists have different sizes.
  FAIL!  : CppTools::Internal::CppToolsPlugin::test_completion(enum_in_class_accessed_in_member_func_inline) Compared lists have different sizes.
  FAIL!  : CppTools::Internal::CppToolsPlugin::test_completion(enum_in_class_accessed_in_member_func) Compared lists have different sizes.
  FAIL!  : CppTools::Internal::CppToolsPlugin::test_cpplocatorfilters_CppLocatorFilter(CppLocatorFilter-filtered) Compared lists have different sizes.
  FAIL!  : CppTools::Internal::CppToolsPlugin::test_cpplocatorfilters_CppCurrentDocumentFilter() Compared lists have different sizes.
  FAIL!  : CppTools::Internal::CppToolsPlugin::test_builtinsymbolsearcher(BuiltinSymbolSearcher::AllTypes) Compared lists have different sizes.
  FAIL!  : CppTools::Internal::CppToolsPlugin::test_builtinsymbolsearcher(BuiltinSymbolSearcher::Enums) Compared lists have different sizes.

Task-number: QTCREATORBUG-21413
Change-Id: I71ace00091e37f0a148086e5047efaec08923b1a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
This commit is contained in:
Nikolai Kosjar
2018-11-01 15:06:32 +01:00
parent 0bc120b87c
commit 0d29fea0b3

View File

@@ -1835,7 +1835,7 @@ bool Parser::parseEnumSpecifier(SpecifierListAST *&node)
return false;
}
if (LA() == T_COLON_COLON && LA() == T_IDENTIFIER)
if (LA() == T_COLON_COLON || LA() == T_IDENTIFIER)
parseName(ast->name);
if (_languageFeatures.cxx11Enabled && LA() == T_COLON) {