Commit 3ba09659 by Aldy Hernandez

c-common.c (fname_decl): New location argument.

        * c-common.c (fname_decl): New location argument.
        * c-common.h (fname_decl): Same.
        * c-parser.c (c_lex_one_token): Use {warning,error}_at instead of
        {warning,error}.
        (c_parser_typeof_specifier): Same.
        (c_parser_parms_list_declarator): Same.
        (c_parser_asm_string_literal): Same.
        (c_parser_compound_statement_nostart): Same.
        (c_parser_label): Same.
        (c_parser_do_statement): Same.
        (c_parser_asm_statement): Same.
        (c_parser_unary_expression): Same.
        (c_parser_sizeof_expression): Same.
        (c_parser_postfix_expression): Same.
        (c_parser_pragma): Same.
        (c_parser_omp_clause_collapse): Same.
        (c_parser_omp_clause_num_threads): Same.
        (c_parser_omp_clause_schedule): Same.
        (c_parser_omp_all_clauses): Same.
        (c_parser_omp_sections_scope): Same.
        (c_parser_omp_for_loop): Same.  Pass condition's location to
        c_objc_common_truthvalue_conversion.
        (c_parser_enum_specifier): Remove comment.
testsuite/
        * gcc.dg/gomp/for-1.c: Test for columns.
        * gcc.dg/func-outside-1.c: Same.
        * gcc.dg/bitfld-7.c: Same.
cp/
        * semantics.c (finish_fname): Pass location to fname_decl.

From-SVN: r140642
parent 19a6a2ea
2008-09-24 Aldy Hernandez <aldyh@redhat.com>
* c-common.c (fname_decl): New location argument.
* c-common.h (fname_decl): Same.
* c-parser.c (c_lex_one_token): Use {warning,error}_at instead of
{warning,error}.
(c_parser_typeof_specifier): Same.
(c_parser_parms_list_declarator): Same.
(c_parser_asm_string_literal): Same.
(c_parser_compound_statement_nostart): Same.
(c_parser_label): Same.
(c_parser_do_statement): Same.
(c_parser_asm_statement): Same.
(c_parser_unary_expression): Same.
(c_parser_sizeof_expression): Same.
(c_parser_postfix_expression): Same.
(c_parser_pragma): Same.
(c_parser_omp_clause_collapse): Same.
(c_parser_omp_clause_num_threads): Same.
(c_parser_omp_clause_schedule): Same.
(c_parser_omp_all_clauses): Same.
(c_parser_omp_sections_scope): Same.
(c_parser_omp_for_loop): Same. Pass condition's location to
c_objc_common_truthvalue_conversion.
(c_parser_enum_specifier): Remove comment.
2008-09-24 Michael J. Eager <eager@eagercon.com>
* config/rs6000/predicates.md (easy_fp_constant): Single FP consts
......@@ -115,6 +141,7 @@
* c-ppoutput.c (cb_used_define): Do nothing for a builtin node.
>>>>>>> .r140641
2008-09-23 Aldy Hernandez <aldyh@redhat.com>
* c-tree.h: Add argument to c_objc_common_truthvalue_conversion,
......
......@@ -988,10 +988,11 @@ fname_as_string (int pretty_p)
now. RID indicates how it should be formatted and IDENTIFIER_NODE
ID is its name (unfortunately C and C++ hold the RID values of
keywords in different places, so we can't derive RID from ID in
this language independent code. */
this language independent code. LOC is the location of the
function. */
tree
fname_decl (unsigned int rid, tree id)
fname_decl (location_t loc, unsigned int rid, tree id)
{
unsigned ix;
tree decl = NULL_TREE;
......@@ -1022,7 +1023,7 @@ fname_decl (unsigned int rid, tree id)
input_location = saved_location;
}
if (!ix && !current_function_decl)
pedwarn (input_location, 0, "%qD is not defined outside of function scope", decl);
pedwarn (loc, 0, "%qD is not defined outside of function scope", decl);
return decl;
}
......
......@@ -690,7 +690,7 @@ extern tree build_void_list_node (void);
extern void start_fname_decls (void);
extern void finish_fname_decls (void);
extern const char *fname_as_string (int);
extern tree fname_decl (unsigned, tree);
extern tree fname_decl (location_t, unsigned, tree);
extern void check_function_arguments (tree, int, tree *, tree);
extern void check_function_arguments_recurse (void (*)
......
2008-09-24 Aldy Hernandez <aldyh@redhat.com>
* semantics.c (finish_fname): Pass location to fname_decl.
2008-09-23 Jakub Jelinek <jakub@redhat.com>
PR c++/37533
......
......@@ -2165,7 +2165,7 @@ finish_fname (tree id)
{
tree decl;
decl = fname_decl (C_RID_CODE (id), id);
decl = fname_decl (input_location, C_RID_CODE (id), id);
if (processing_template_decl)
decl = DECL_NAME (decl);
return decl;
......
2008-09-24 Aldy Hernandez <aldyh@redhat.com>
* gcc.dg/gomp/for-1.c: Test for columns.
* gcc.dg/func-outside-1.c: Same.
* gcc.dg/bitfld-7.c: Same.
2008-09-24 Steve Ellcey <sje@cup.hp.com>
* gcc.dg/utf-array.c: Fix syntax of dg-error stmts.
......
/* Test for rejection of typeof on bit-fields. PR c/10333. */
/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
/* { dg-do compile } */
/* { dg-options "" } */
/* { dg-options "-fshow-column" } */
struct { int a:1; } x;
typeof (x.a) z; /* { dg-error "applied to a bit-field" "typeof" } */
typeof (x.a) z; /* { dg-error "9:applied to a bit-field" "typeof" } */
......@@ -2,8 +2,8 @@
are OK there). Test with no special options. */
/* Origin: Joseph Myers <joseph@codesourcery.com> */
/* { dg-do compile } */
/* { dg-options "" } */
/* { dg-options "-fshow-column" } */
const char *a = __func__; /* { dg-warning "'__func__' is not defined outside of function scope" "undef" } */
const char *a = __func__; /* { dg-warning "17:'__func__' is not defined outside of function scope" "undef" } */
const char *b = __FUNCTION__;
const char *c = __PRETTY_FUNCTION__;
/* { dg-do compile } */
/* { dg-options "-fopenmp -fshow-column" } */
void foo (int j, int k)
{
......@@ -23,7 +24,7 @@ void foo (int j, int k)
/* Malformed parallel loops. */
#pragma omp for
i = 0; /* { dg-error "for statement expected" } */
i = 0; /* { dg-error "3:for statement expected" } */
for ( ; i < 10; )
{
baz (i);
......@@ -39,7 +40,7 @@ void foo (int j, int k)
}
#pragma omp for
for (i = 0; i < 10 && j > 4; i-=3) /* { dg-error "invalid controlling predicate" } */
for (i = 0; i < 10 && j > 4; i-=3) /* { dg-error "15:invalid controlling predicate" } */
baz (i);
#pragma omp for
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment