Skip to content

Commit e48e340

Browse files
committed
diagnostics: convert diagnostic_t to enum class diagnostics::kind: restore build with GCC 5
Building with GCC 5, with commit 3cc27ed "diagnostics: convert diagnostic_t to enum class diagnostics::kind", we got: ../../source-gcc/gcc/diagnostics/option-classifier.cc: In member function ‘diagnostics::kind diagnostics::option_classifier::update_effective_level_from_pragmas(diagnostics::diagnostic_info*) const’: ../../source-gcc/gcc/diagnostics/option-classifier.cc:212:20: error: ‘kind’ is not a class, namespace, or enumeration if (kind != kind::unspecified) ^ make[2]: *** [Makefile:1212: diagnostics/option-classifier.o] Error 1 Resolve this similar to, for example, commit r14-4521-g08d0f840dc7ad212ab75d094373b01cbfc004e67 "analyzer: fix build with gcc < 6". gcc/ * diagnostics/option-classifier.cc (update_effective_level_from_pragmas): In presence of local variable 'kind', explicitly state 'diagnostics::' scope for 'kind' enum.
1 parent 7ac42d3 commit e48e340

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

gcc/diagnostics/option-classifier.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ update_effective_level_from_pragmas (diagnostic_info *diagnostic) const
209209
if (opt_id == 0 || opt_id == diagnostic->m_option_id)
210210
{
211211
enum kind kind = p->kind;
212-
if (kind != kind::unspecified)
212+
if (kind != diagnostics::kind::unspecified)
213213
diagnostic->m_kind = kind;
214214
return kind;
215215
}

0 commit comments

Comments
 (0)