diff --git a/gcc/cobol/cbldiag.h b/gcc/cobol/cbldiag.h index bfc72f3921390a7194a53fdd8adf8bbd834906b3..7fc479da151e43d485b8d865f86c5eaf9ecf3402 100644 --- a/gcc/cobol/cbldiag.h +++ b/gcc/cobol/cbldiag.h @@ -73,8 +73,7 @@ struct YDFLTYPE #endif // an error at a location, called from the parser for semantic errors -template <typename LOC> -void error_msg( const LOC& loc, const char gmsgid[], ... ); +void error_msg( const YYLTYPE& loc, const char gmsgid[], ... ); void dialect_error( const YYLTYPE& loc, const char term[], const char dialect[] ); @@ -96,8 +95,7 @@ void cbl_unimplemented_at( const YYLTYPE& loc, const char *gmsgid, ... ); void dbgerr( const char fmt[], ... ); void dbgmsg( const char fmt[], ... ); -template <typename LOC> -void gcc_location_set( const LOC& loc ); +void gcc_location_set( const YYLTYPE& loc ); // tree.h defines yy_flex_debug as a macro because options.h #if ! defined(yy_flex_debug) @@ -110,6 +108,6 @@ location_dump( const char func[], int line, const char tag[], const LOC& loc) { func, line, tag, loc.first_line, loc.first_column, loc.last_line, loc.last_column); } -#endif +#endif // defined(yy_flex_debug) #endif diff --git a/gcc/cobol/gcobol.1 b/gcc/cobol/gcobol.1 index 0d3898818c7b20e328943317ae6ae446724dee57..415ad36aa786398ae69a91148ea9ebfdfff5a411 100644 --- a/gcc/cobol/gcobol.1 +++ b/gcc/cobol/gcobol.1 @@ -98,7 +98,7 @@ to have the value of .Ar expr . .It Fl E Write the CDF-processed \*[lang] input to standard output in free-form -reference format. Certain non-\*[lang] markers are included in the +reference format. Certain non-\*[lang] markers are included in the output to indicate where copybook files were included. For line-number consistency with the input, blank lines are retained. .Pp @@ -308,7 +308,7 @@ the primary source file. If .Ar filename is not an absolute path, the directory searched is the current working directory, not the directory containing the main source file. The -name is used verbatim. No permutations are applied, and no +name is used verbatim. No permutations are applied, and no directories searched. .Pp If multiple diff --git a/gcc/cobol/util.cc b/gcc/cobol/util.cc index 5891ae853dd15f057ec2f8599ac982b7dd23b8f7..4737187497302b4af632fb7e903789c8107e5f6b 100644 --- a/gcc/cobol/util.cc +++ b/gcc/cobol/util.cc @@ -1920,8 +1920,8 @@ cobol_filename_restore() { static location_t token_location; template <typename LOC> -void -gcc_location_set( const LOC& loc ) { +static void +gcc_location_set_impl( const LOC& loc ) { token_location = linemap_line_start( line_table, loc.last_line, 80 ); token_location = linemap_position_for_column( line_table, loc.first_column); location_dump(__func__, __LINE__, "parser", loc); @@ -2007,20 +2007,9 @@ class temp_loc_t : protected YYLTYPE { } }; -// These uses of the error_msg function are never invoked, but encourage the -// compiler to instantiate the templates. -namespace none { - void foo() { - error_msg(YYLTYPE(), "fake"); - error_msg(YDFLTYPE(), "also fake"); - gcc_location_set(YYLTYPE()); - gcc_location_set(YDFLTYPE()); - } -}; - template <typename LOC> void -error_msg( const LOC& loc, const char gmsgid[], ... ) { +static error_msg_impl( const LOC& loc, const char gmsgid[], ... ) { temp_loc_t looker(loc); verify_format(gmsgid); parse_error_inc(); @@ -2034,6 +2023,22 @@ error_msg( const LOC& loc, const char gmsgid[], ... ) { global_dc->end_group(); } +void error_msg( const YYLTYPE& loc, const char gmsgid[], ... ) { + error_msg_impl(loc, gmsgid); +} + +void error_msg( const YDFLTYPE& loc, const char gmsgid[], ... ) { + error_msg_impl(loc, gmsgid); +} + +void gcc_location_set( const YYLTYPE& loc ) { + gcc_location_set_impl(loc); +} + +void gcc_location_set( const YDFLTYPE& loc ) { + gcc_location_set_impl(loc); +} + void cdf_location_set(YYLTYPE loc) { extern YDFLTYPE ydflloc;