diagnostics: move diagnostic.c to diagnostics/context.cc: restore build with GCC 5
Building with GCC 5, with commit
8d9d9515f5db9bab758e484f3956033150931de5
"diagnostics: move diagnostic.c to diagnostics/context.cc", we got:
../../source-gcc/gcc/diagnostics/context.cc: In member function ‘bool diagnostics::context::diagnostic_impl(rich_location*, const diagnostics::metadata*, diagnostics::option_id, const char*, __va_list_tag (*)[1], diagnostics::kind)’:
../../source-gcc/gcc/diagnostics/context.cc:1514:15: error: ‘kind’ is not a class, namespace, or enumeration
if (kind == kind::permerror)
^
../../source-gcc/gcc/diagnostics/context.cc:1517:22: error: ‘kind’ is not a class, namespace, or enumeration
m_permissive ? kind::warning : kind::error);
^
../../source-gcc/gcc/diagnostics/context.cc:1517:38: error: ‘kind’ is not a class, namespace, or enumeration
m_permissive ? kind::warning : kind::error);
^
../../source-gcc/gcc/diagnostics/context.cc:1523:19: error: ‘kind’ is not a class, namespace, or enumeration
if (kind == kind::warning || kind == kind::pedwarn)
^
../../source-gcc/gcc/diagnostics/context.cc:1523:44: error: ‘kind’ is not a class, namespace, or enumeration
if (kind == kind::warning || kind == kind::pedwarn)
^
../../source-gcc/gcc/diagnostics/context.cc: In member function ‘bool diagnostics::context::diagnostic_n_impl(rich_location*, const diagnostics::metadata*, diagnostics::option_id, long unsigned int, const char*, const char*, __va_list_tag (*)[1], diagnostics::kind)’:
../../source-gcc/gcc/diagnostics/context.cc:1554:15: error: ‘kind’ is not a class, namespace, or enumeration
if (kind == kind::warning)
^
make[2]: *** [Makefile:1212: diagnostics/context.o] Error 1
Resolve this similar to, for example,
commit
r14-4521-g08d0f840dc7ad212ab75d094373b01cbfc004e67
"analyzer: fix build with gcc < 6".
gcc/
* diagnostics/context.cc (context::diagnostic_impl)
(context::diagnostic_n_impl): In presence of formal parameter
'kind', explicitly state 'diagnostics::' scope for 'kind' enum.