diff options
author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-07-21 19:37:05 +0000 |
---|---|---|
committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-07-21 19:37:05 +0000 |
commit | b2009e332c150356085f0fb0e35a3a452b10c378 (patch) | |
tree | c188ce224e4d028d0ab5f3313b2bc6e749eb88e9 /gcc/c-family | |
parent | 323d3e1d50a7a2022e587b786d010c22812a6d5a (diff) | |
download | gcc-b2009e332c150356085f0fb0e35a3a452b10c378.tar.gz |
2011-07-21 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 176576 using svnmerge.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@176583 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-family')
-rw-r--r-- | gcc/c-family/ChangeLog | 14 | ||||
-rw-r--r-- | gcc/c-family/c-common.c | 4 | ||||
-rw-r--r-- | gcc/c-family/c-common.h | 24 | ||||
-rw-r--r-- | gcc/c-family/c-omp.c | 2 |
4 files changed, 42 insertions, 2 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index 38149c8c6dd..c5f2306ca62 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,17 @@ +2011-07-20 Jason Merrill <jason@redhat.com> + + PR c++/6709 (DR 743) + PR c++/42603 (DR 950) + * c-common.h (CPP_KEYWORD, CPP_TEMPLATE_ID): Move from cp/parser.h. + (CPP_NESTED_NAME_SPECIFIER, N_CP_TTYPES): Likewise. + (CPP_DECLTYPE): New. + * c-common.c (c_parse_error): Handle CPP_DECLTYPE. + +2011-07-19 Richard Guenther <rguenther@suse.de> + + * c-common.c (pointer_int_sum): Use fold_build_pointer_plus. + * c-omp.c (c_finish_omp_for): Likewise. + 2011-07-12 Eric Botcazou <ebotcazou@adacore.com> * c-ada-spec.c (dump_nested_types): Put semi-colon after empty loop diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c index 3ffacd5b444..6078d948ae4 100644 --- a/gcc/c-family/c-common.c +++ b/gcc/c-family/c-common.c @@ -3760,7 +3760,7 @@ pointer_int_sum (location_t loc, enum tree_code resultcode, if (resultcode == MINUS_EXPR) intop = fold_build1_loc (loc, NEGATE_EXPR, sizetype, intop); - ret = fold_build2_loc (loc, POINTER_PLUS_EXPR, result_type, ptrop, intop); + ret = fold_build_pointer_plus_loc (loc, ptrop, intop); fold_undefer_and_ignore_overflow_warnings (); @@ -8329,6 +8329,8 @@ c_parse_error (const char *gmsgid, enum cpp_ttype token_type, message = catenate_messages (gmsgid, " before %<#pragma%>"); else if (token_type == CPP_PRAGMA_EOL) message = catenate_messages (gmsgid, " before end of line"); + else if (token_type == CPP_DECLTYPE) + message = catenate_messages (gmsgid, " before %<decltype%>"); else if (token_type < N_TTYPES) { message = catenate_messages (gmsgid, " before %qs token"); diff --git a/gcc/c-family/c-common.h b/gcc/c-family/c-common.h index a80c0eaec40..13aae0f3ecc 100644 --- a/gcc/c-family/c-common.h +++ b/gcc/c-family/c-common.h @@ -320,6 +320,30 @@ struct c_common_resword const unsigned int disable : 16; }; +/* Extra cpp_ttype values for C++. */ + +/* A token type for keywords, as opposed to ordinary identifiers. */ +#define CPP_KEYWORD ((enum cpp_ttype) (N_TTYPES + 1)) + +/* A token type for template-ids. If a template-id is processed while + parsing tentatively, it is replaced with a CPP_TEMPLATE_ID token; + the value of the CPP_TEMPLATE_ID is whatever was returned by + cp_parser_template_id. */ +#define CPP_TEMPLATE_ID ((enum cpp_ttype) (CPP_KEYWORD + 1)) + +/* A token type for nested-name-specifiers. If a + nested-name-specifier is processed while parsing tentatively, it is + replaced with a CPP_NESTED_NAME_SPECIFIER token; the value of the + CPP_NESTED_NAME_SPECIFIER is whatever was returned by + cp_parser_nested_name_specifier_opt. */ +#define CPP_NESTED_NAME_SPECIFIER ((enum cpp_ttype) (CPP_TEMPLATE_ID + 1)) + +/* A token type for pre-parsed C++0x decltype. */ +#define CPP_DECLTYPE ((enum cpp_ttype) (CPP_NESTED_NAME_SPECIFIER + 1)) + +/* The number of token types, including C++-specific ones. */ +#define N_CP_TTYPES ((int) (CPP_DECLTYPE + 1)) + /* Disable mask. Keywords are disabled if (reswords[i].disable & mask) is _true_. Thus for keywords which are present in all languages the disable field is zero. */ diff --git a/gcc/c-family/c-omp.c b/gcc/c-family/c-omp.c index d2256ffd376..340656fa14f 100644 --- a/gcc/c-family/c-omp.c +++ b/gcc/c-family/c-omp.c @@ -424,7 +424,7 @@ c_finish_omp_for (location_t locus, tree declv, tree initv, tree condv, if (TREE_CODE (incr) == POSTDECREMENT_EXPR || TREE_CODE (incr) == PREDECREMENT_EXPR) t = fold_build1_loc (elocus, NEGATE_EXPR, sizetype, t); - t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (decl), decl, t); + t = fold_build_pointer_plus (decl, t); incr = build2 (MODIFY_EXPR, void_type_node, decl, t); } break; |