summaryrefslogtreecommitdiff
path: root/libcpp
Commit message (Collapse)AuthorAgeFilesLines
* * lex.c (search_line_sse42): Use __builtin_ia32_loaddqu anduros2012-06-192-2/+10
| | | | | | | | __builtin_ia32_pcmpestri128 instead of asm. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@188782 138bc75d-0d04-0410-961f-82ee72b054a4
* * cpplib.pot: Regenerate.jsm282012-06-132-194/+145
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@188533 138bc75d-0d04-0410-961f-82ee72b054a4
* * sr.po: New.jsm282012-06-132-0/+959
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@188528 138bc75d-0d04-0410-961f-82ee72b054a4
* * line-map.c (linemap_enter_macro): Don't zero max_column_hint injason2012-06-052-1/+6
| | | | | | | every macro. This improves performance by reducing the number of reallocations when track-macro-expansion is on. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@188242 138bc75d-0d04-0410-961f-82ee72b054a4
* PR preprocessor/53463 - Fix system header detection for built-in macro tokensdodji2012-06-042-4/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The location for a built-in macro token is BUILTIN_LOCATION. When we see that location value, we cannot know if that token was used in a system header or not. And that can trigger some unwanted warnings on e.g, the use of __LONG_LONG_MAX__ built-in macro in system headers when we compile with -pedantic, like in the test case accompanying this patch. In that case, I think we ought to step-up to see where the built-in macro has been expanded, until we see a location that is not for a built-in macro. Then we can check if the resulting location is in a system header or not. Now that we step up to the location of first non-built-in-macro token, it appeared that for testsuite/c-c++-common/dfp/convert-int-saturate.c, G++ then fails to emit the warning in: volatile unsigned int usi; int main () { usi = DEC32_MAX; /* { dg-warning "overflow in implicit constant conversion" } */ ... } Because DEC32_MAX is defined in the system header float.h as a built-in macro: #define DEC32_MAX __DEC32_MAX__ And during the parsing of the assignment expression that should have led to the warning above, input_location is set to the location for the DEC32_MAX, which is actually the location for the built-in __DECL32_MAX_EXP. A possible fix is to use the location of the "=" operator as the default location for assignment expressions. This is what the patch does. I had to adjust a couple of tests to arrange for this. Bootstrapped and tested on x86_64-unknown-linux-gnu against trunk. libcpp/ PR preprocessor/53463 * line-map.c (linemap_location_in_system_header_p): For built-in macro tokens, check the first expansion point location for that is not for a token coming from a built-in macro. gcc/cp/ PR preprocessor/53463 * parser.c (cp_parser_assignment_expression): Use the location for the LHS as the default location for the expression. gcc/testsuite/ PR preprocessor/53463 * g++.dg/cpp/limits.C: New test. * g++.dg/parse/error19.C: Adjust. * g++.dg/warn/Wconversion-real-integer2.C: Likewise. * g++.dg/warn/pr35635.C: Likewise. * g++.old-deja/g++.pt/assign1.C: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@188203 138bc75d-0d04-0410-961f-82ee72b054a4
* * directives.c: Fix typos.jsm282012-05-295-13/+20
| | | | | | | | | * include/line-map.h: Fix typos. * line-map.c: Fix typos. * macro.c: Fix typos. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187966 138bc75d-0d04-0410-961f-82ee72b054a4
* PR bootstrap/53459 - unused local typedef when building on altivecdodji2012-05-292-2/+8
| | | | | | | | PR bootstrap/53459 * lex.c (search_line_fast): Avoid unused local typedefs to simulate a static assertion. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187947 138bc75d-0d04-0410-961f-82ee72b054a4
* Revert "PR bootstrap/53459 - unused local typedef when building on altivec"dodji2012-05-292-5/+1
| | | | | | This reverts commit r187853 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187946 138bc75d-0d04-0410-961f-82ee72b054a4
* PR preprocessor/53229 - Fix diagnostics location when pasting tokensdodji2012-05-294-50/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As stated in the audit trail of this problem report, consider this test case: $ cat test.c 1 struct x { 2 int i; 3 }; 4 struct x x; 5 6 #define TEST(X) x.##X 7 8 void foo (void) 9 { 10 TEST(i) = 0; 11 } $ $ cc1 -quiet test.c test.c: In function 'foo': test.c:10:1: error: pasting "." and "i" does not give a valid preprocessing token TEST(i) = 0; ^ $ So, when pasting tokens, the error diagnostic uses the global and imprecise input_location variable, leading to an imprecise output. To properly fix this, I think libcpp should keep the token of the pasting operator '##', instead of representing it with flag on the LHS operand's token. That way, it could use its location. Doing that would be quite intrusive though. So this patch just uses the location of the LHS of the pasting operator, for now. It's IMHO better than the current situation. The patch makes paste_tokens take a location parameter that is used in the diagnostics. This change can still be useful later when we can use the location of the pasting operator, because paste_tokens will just be passed the new, more precise location. Incidentally, it appeared that when getting tokens from within preprocessor directives (like what is done in gcc.dg/cpp/paste12.c), with -ftrack-macro-expansion disabled, the location of the expansion point of macros was being lost because cpp_reader::set_invocation_location wasn't being properly set. It's because when cpp_get_token_1 calls enter_macro_context, there is a little period of time between the beginning of that later function and when the macro is really pushed (and thus when the macro is really expanded) where we wrongly consider that we are not expanding the macro because macro_of_context is still NULL. In that period of time, in the occurrences of indirect recursive calls to cpp_get_token_1, this later function wrongly sets cpp_reader::invocation_location because cpp_reader::set_invocation_location is not being properly set. To avoid that confusion the patch does away with cpp_reader::set_invocation_location and introduces a new flag cpp_reader::about_to_expand_macro_p that is set in the small time interval exposed earlier. A new in_macro_expansion_p is introduced as well, so that cpp_get_token_1 can now accurately detect when we are in the process of expanding a macro, and thus correctly collect the location of the expansion point. People seem to like screenshots. Thus, after the patch, we now have: $ cc1 -quiet test.c test.c: In function 'foo': test.c:6:18: error: pasting "." and "i" does not give a valid preprocessing token #define TEST(X) x.##X ^ test.c:10:3: note: in expansion of macro 'TEST' TEST(i) = 0; ^ $ Bootstrapped and tested on x86_64-unknown-linux-gnu against trunk. libcpp/ PR preprocessor/53229 * internal.h (cpp_reader::set_invocation_location): Remove. (cpp_reader::about_to_expand_macro_p): New member flag. * directives.c (do_pragma): Remove Kludge as pfile->set_invocation_location is no more. * macro.c (cpp_get_token_1): Do away with the use of cpp_reader::set_invocation_location. Just collect the macro expansion point when we are about to expand the top-most macro. Do not override cpp_reader::about_to_expand_macro_p. This fixes gcc.dg/cpp/paste12.c by making get_token_no_padding properly handle locations of expansion points. (cpp_get_token_with_location): Adjust, as cpp_reader::set_invocation_location is no more. (paste_tokens): Take a virtual location parameter for the LHS of the pasting operator. Use it in diagnostics. Update comments. (paste_all_tokens): Tighten the assert. Propagate the location of the expansion point when no virtual locations are available. Pass the virtual location to paste_tokens. (in_macro_expansion_p): New static function. (enter_macro_context): Set the cpp_reader::about_to_expand_macro_p flag until we really start expanding the macro. gcc/testsuite/ PR preprocessor/53229 * gcc.dg/cpp/paste6.c: Force to run without -ftrack-macro-expansion. * gcc.dg/cpp/paste8.c: Likewise. * gcc.dg/cpp/paste8-2.c: New test, like paste8.c but run with -ftrack-macro-expansion. * gcc.dg/cpp/paste12.c: Force to run without -ftrack-macro-expansion. * gcc.dg/cpp/paste12-2.c: New test, like paste12.c but run with -ftrack-macro-expansion. * gcc.dg/cpp/paste13.c: Likewise. * gcc.dg/cpp/paste14.c: Likewise. * gcc.dg/cpp/paste14-2.c: New test, like paste14.c but run with -ftrack-macro-expansion. * gcc.dg/cpp/paste18.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187945 138bc75d-0d04-0410-961f-82ee72b054a4
* PR bootstrap/53459 - unused local typedef when building on altivecdodji2012-05-242-1/+5
| | | | | | | | | libcpp/ PR bootstrap/53459 * lex.c (search_line_fast): Remove unused typedef check_count. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187853 138bc75d-0d04-0410-961f-82ee72b054a4
* PR preprocessor/7263 - Avoid pedantic warnings on system headers macro tokensdodji2012-05-163-75/+124
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that we track token locations accross macro expansions, it would be cool to be able to fix PR preprocessor/7263 for real. That is, consider this example where we have a system header named header.h like this: #define _Complex __complex__ #define _Complex_I 1.0iF and then a normal C file like this: #include "header.h" static _Complex float c = _Complex_I; If we compile the file with -pedantic, the usages of _Complex or _Complex_I should not trigger any warning, even though __complex__ and the complex literal are extensions to the standard C. They shouldn't trigger any warning because _Complex and _Complex_I are defined in a system header (and expanded in normal user code). To be able to handle this, we must address two separate concerns. First, warnings about non-standard usage of numerical literals are emitted directly from within libcpp. So we must teach libcpp's parser for numerical literals to use virtual locations, instead of the spelling location it uses today. Once we have that, as the diagnostics machinery already knows how to avoid emitting errors happening on tokens that come from system headers, we win. Second, there is the issue of tracking locations for declaration specifiers, like the "_Complex" in the declaration: static _Complex float c; For that, we need to arrange for each possible declaration specifier to have its own location, because otherwise, we'd warn on e.g, on: _Complex float c; but not on: static _Complex float c; So this patch addresses the two concerns above. It's actually a follow-up on an earlier patch[1] I wrote as part of my initial work on virtual locations. We then agreed[2] that the second concern was important to address before the patch could get a chance to go in. [1]: http://gcc.gnu.org/ml/gcc-patches/2011-09/msg00957.html [2]: http://gcc.gnu.org/ml/gcc-patches/2011-10/msg00264.html Bootstrapped and tested on x86_64-unknown-linux-gnu against trunk. libcpp/ PR preprocessor/7263 * include/cpplib.h (cpp_classify_number): Take a location parameter. * expr.c (SYNTAX_ERROR_AT, SYNTAX_ERROR2_AT): New diagnostic macros that take a location parameter. (cpp_classify_number): Take a (virtual) location parameter. Use it for diagnostics. Adjust comments. (eval_token): Take a location parameter. Pass it to cpp_classify_number and to diagnostic routines. (_cpp_parse_expr): Use virtual locations of tokens when parsing expressions. Pass a virtual location to eval_token and to diagnostic routines. gcc/c-family/ PR preprocessor/7263 * c-lex.c (c_lex_with_flags): Pass a virtual location to the call to cpp_classify_number. For diagnostics, use the precise location instead of the global input_location. gcc/ PR preprocessor/7263 * c-tree.h (enum c_declspec_word): Declare new enum. (struct c_declspecs::locations): New member. (declspecs_add_qual, declspecs_add_scspec) (declspecs_add_addrspace, declspecs_add_alignas): Take a new location parameter. * c-decl.c (build_null_declspecs): Initialize the new struct c_declspecs::locations member. (declspecs_add_addrspace): Take a location parameter for the address space. Store it onto declaration specifiers. (declspecs_add_qual): Likewise, take a location parameter for the qualifier. (declspecs_add_type): Likewise, take a location parameter for the type specifier. (declspecs_add_scspec): Likewise, take a location parameter for the storage class specifier. (declspecs_add_attrs): Likewise, take a location parameter for the first attribute. (declspecs_add_alignas): Likewise, take a location parameter for the alignas token. (finish_declspecs): For diagnostics, use the location of the relevant declspec, instead of the global input_location. * c-parser.c (c_parser_parameter_declaration): Pass the precise virtual location of the declspec to the declspecs-setters. (c_parser_declspecs): Likewise. Avoid calling c_parser_peek_token repeatedly. gcc/cp/ PR preprocessor/7263 * cp-tree.h (enum cp_decl_spec): Add new enumerators to cover all the possible declarator specifiers so far. (struct cp_decl_specifier_seq::locations): Declare new member. (cp_decl_specifier_seq::{specs, type_location}): Remove. (decl_spec_seq_has_spec_p): Declare new function. * parser.c (cp_parser_check_decl_spec): Remove. (set_and_check_decl_spec_loc): Define new static function. (decl_spec_seq_has_spec_p): Define new public function. (cp_parser_decl_specifier_seq, cp_parser_function_specifier_opt) (cp_parser_type_specifier, cp_parser_simple_type_specifier) (cp_parser_set_storage_class, cp_parser_set_decl_spec_type) (cp_parser_alias_declaration): Set the locations for each declspec, using set_and_check_decl_spec_loc. (cp_parser_explicit_instantiation, cp_parser_init_declarator) (cp_parser_member_declaration, cp_parser_init_declarator): Use the new declspec location for specifiers. Use the new decl_spec_seq_has_spec_p. (cp_parser_type_specifier_seq): Use the new set_and_check_decl_spec_loc. Stop using cp_parser_check_decl_spec. Use the new decl_spec_seq_has_spec_p. (, cp_parser_init_declarator): Use the new set_and_check_decl_spec_loc. (cp_parser_single_declaration, cp_parser_friend_p) (cp_parser_objc_class_ivars, cp_parser_objc_struct_declaration): Use the new decl_spec_seq_has_spec_p. * decl.c (check_tag_decl): Use new decl_spec_seq_has_spec_p. Use the more precise ds_redefined_builtin_type_spec location for diagnostics about re-declaring C++ built-in types. (start_decl, grokvardecl, grokdeclarator): Use the new decl_spec_seq_has_spec_p. gcc/testsuite/ PR preprocessor/7263 * gcc.dg/binary-constants-2.c: Run without tracking locations accross macro expansion. * gcc.dg/binary-constants-3.c: Likewise. * gcc.dg/cpp/sysmac2.c: Likewise. * testsuite/gcc.dg/nofixed-point-2.c: Adjust for more precise location. * gcc.dg/cpp/syshdr3.c: New test. * gcc.dg/cpp/syshdr3.h: New header for the new test above. * gcc.dg/system-binary-constants-1.c: New test. * gcc.dg/system-binary-constants-1.h: New header for the new test above. * g++.dg/cpp/syshdr3.C: New test. * g++.dg/cpp/syshdr3.h: New header the new test above. * g++.dg/system-binary-constants-1.C: New test. * g++.dg/system-binary-constants-1.h: New header the new test above. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187587 138bc75d-0d04-0410-961f-82ee72b054a4
* 2012-05-10 Tristan Gingold <gingold@adacore.com>gingold2012-05-102-6/+11
| | | | | | | | * expr.c (interpret_float_suffix): Add a guard. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187364 138bc75d-0d04-0410-961f-82ee72b054a4
* Properly initialize cpp_context in destringize_and_rundodji2012-05-023-4/+14
| | | | | | | | | | | | | | | | | | | | | | | destringize_and_run forgets to initialize all the fields of the cpp_context that it pushes. Later _cpp_pop_context then gets confused when it accesses context->tokens_kind via the call to macro_of_context on context->prev. The first hunk of this patch is the real obvious fix. The second hunk is just an assert that I am adding to err on the safe side. Tested by on x86_64-unknown-linux-gnu against trunk by running the test gcc.dg/gomp/macro-4.c under Valgrind, and bootstrapped. libcpp/ * directives.c (destringize_and_run): Properly initialize the new context. * macro.c (_cpp_pop_context): Assert that we shouldn't try to pop the initial base context, which has the same life time as the current instance of cpp_file. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187054 138bc75d-0d04-0410-961f-82ee72b054a4
* * libcpp/ChangeLog: Fix PR number.manu2012-04-301-1/+1
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186992 138bc75d-0d04-0410-961f-82ee72b054a4
* 2012-04-30 Manuel López-Ibáñez <manu@gcc.gnu.org>manu2012-04-302-1/+41
| | | | | | | | | | | Dodji Seketeli <dodji@seketeli.org> PR c++/52974 * libcpp/files.c (maybe_shorter_path): New. (find_file_in_dir): Use it. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186991 138bc75d-0d04-0410-961f-82ee72b054a4
* Switch -ftrack-macro-expansion=2 on by default.dodji2012-04-302-0/+10
| | | | | | | | | | | | | | | | | | This switches the compiler to -ftrack-macro-expansion=2 by default. Tested and bootstrapped on x86_64-unknown-linux-gnu against trunk. libcpp/ * init.c (cpp_create_reader): Switch -ftrack-macro-expansion=2 on by default. Add comments. gcc/docs/ * cppopts.texi: Adjust for enabling -ftrack-macro-expansion=2 by default. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186977 138bc75d-0d04-0410-961f-82ee72b054a4
* Strip "<built-in>" loc from displayed expansion contextdodji2012-04-303-1/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that diagnostics for tokens coming from macro expansions point to the spelling location of the relevant token (and then displays the context of the expansion), some ugly (not so seldom) corner cases can happen. When the relevant token is a built-in token (which means the location of that token is BUILTINS_LOCATION) the location prefix displayed to the user in the diagnostic line is the "<built-in>:0:0" string. For instance: <built-in>:0:0: warning: conversion to 'float' alters 'int' constant value For the user, I think this is surprising and useless. A more user-friendly approach would be to refer to the first location that (in the reported macro expansion context) is for a location in real source code, like what is shown in the new test case gcc/testsuite/g++.dg/warn/Wconversion-real-integer2.C accompanying this patch. To do this, I am making the line-map module provide a new linemap_unwind_to_first_non_reserved_loc function that resolves a virtual location to the first spelling location that is in real source code. I am then using that facility in the diagnostics printing module and in the macro unwinder to avoid printing diagnostics lines that refer to the locations for built-ins or more generally for reserved locations. Note that when I start the dance of skipping a built-in location I also skip locations that are in system headers, because it turned out that a lot of those built-ins are actually used in system headers (e.g, "#define INT_MAX __INT_MAX__" where __INT_MAX__ is a built-in). Besides the user-friendliness gain, this patch allows a number of regression tests to PASS unchanged with and without -ftrack-macro-expansion. Tested and bootstrapped on x86_64-unknown-linux-gnu against trunk. Note that the bootstrap with -ftrack-macro-expansion exhibits other separate issues that are addressed in subsequent patches. This patch just fixes one class of problems. The patch does pass bootstrap with -ftrack-macro-expansion turned off, though. libcpp/ * include/line-map.h (linemap_unwind_toward_expansion): Fix typo in comment. (linemap_unwind_to_first_non_reserved_loc): Declare new function. * line-map.c (linemap_unwind_to_first_non_reserved_loc): Define new function. gcc/ * input.c (expand_location_1): When expanding to spelling location in a context of a macro expansion, skip reserved system header locations. Update comments. * tree-diagnostic.c (maybe_unwind_expanded_macro_loc): Likewise. gcc/testsuite/ * g++.dg/warn/Wconversion-real-integer2.C: New test. * g++.dg/warn/Wconversion-real-integer-3.C: Likewise. * g++.dg/warn/conversion-real-integer-3.h: New header used by the new test above. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186970 138bc75d-0d04-0410-961f-82ee72b054a4
* Fix expansion point loc for macro-like tokensdodji2012-04-302-8/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Consider the test case gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-5.c. Its interesting part is: #define A(x) vari x /* line 7. */ #define vari(x) #define B , varj int A(B) ; /* line 10. */ In its initial version, this test was being pre-processed as: # 1 "gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-5.c" # 1 "build/gcc//" # 1 "<command-line>" # 1 "gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-5.c" # 10 "gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-5.c" int # 7 "gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-5.c" vari , varj ; Note how "int" and "vari" are on separate lines, whereas "int" and ", varj" are on the same line. This looks like a bug to me, even independantly from the macro location tracking work. With macro location tracking turned on, the preprocessed output becomes: # 1 "gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-5.c" # 1 "<command-line>" # 1 "gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-5.c" # 10 "gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-5.c" int vari , varj ; Which, IMO, is what we'd expect. This is due to an unexpected side effect of enter_macro_context when passed a token that might look like a function-like macro at first sight, but that it eventually considers to not be a macro after all. This is the case for the "vari" token which looks like a macro when it is first lexed, but is eventually considered to be a normal token by enter_macro_context because it's not used as a function-like macro invocation. In that case, besides returning NULL, enter_macro_context sets pfile->context->c.macro to NULL, making cpp_get_token_1 forget to set the location of the "vari" to the expansion point of A. enter_macro_context sets pfile->context->c.macro to NULL in that case because funlike_invocation_p reads one token pass "foo", sees that there is no '(' token, so we are not invoking the function-like parameter. It then puts the tokens (which it has read after "foo") back into the tokens stream by calling _cpp_push_token_context on it, which sets pfile->context->c.macro to NULL, saying in essence that the current macro expansion context is "stopped". The fix here is to teach _cpp_push_token and push_extended_tokens_context to continue the current macro context when passed a NULL macro. But then, now that there can be several continguous contexts associated with the same macro, we need to teach _cpp_pop_context to re-enable the expansion of the current macro only when we are really out of expanding the current macro. Otherwise we can run in cases where we have recursive expansions of the same macro. Tested on x86_64-unknown-linux-gnu against trunk. Now this test has the same output with and without tracking locations accross macro expansions. Note that the bootstrap with -ftrack-macro-expansion exhibits other separate issues that are addressed in subsequent patches. This patch just fixes one class of problems. The patch does pass bootstrap with -ftrack-macro-expansion turned off, though. libcpp/ * macro.c (macro_of_context): New static function. (_cpp_push_token_context, push_extended_tokens_context): If the macro argument is NULL, it means we are continuing the expansion of the current macro, if any. Update comments. (_cpp_pop_context): Re-enable expansion of the macro only when we are really out of the context of the current expansion. gcc/testsuite/ * gcc.dg/debug/dwarf2/pr41445-5.c: Adjust. * gcc.dg/debug/dwarf2/pr41445-6.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186968 138bc75d-0d04-0410-961f-82ee72b054a4
* Fix token pasting with -ftrack-macro-expansiondodji2012-04-302-1/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch makes token pasting work with -ftrack-macro-expansion turned on. It improves some pasting related tests of the gcc.dg/cpp subdirectory. Tested and bootstrapped on x86_64-unknown-linux-gnu against trunk. Note that the bootstrap with -ftrack-macro-expansion exhibits other separate issues that are addressed in subsequent patches. This patch just fixes one class of problems. The patch does pass bootstrap with -ftrack-macro-expansion turned off, though. libcpp/ * macro.c (paste_all_tokens): Put the token resulting from pasting into an extended token context with -ftrack-macro-location is in effect. gcc/testsuite/ * gcc.dg/cpp/paste17.c: New test case for -ftrack-macro-expansion=2 mode only. * gcc.dg/cpp/macro-exp-tracking-5.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186966 138bc75d-0d04-0410-961f-82ee72b054a4
* Fix cpp_sys_macro_p with -ftrack-macro-expansiondodji2012-04-302-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | cpp_sys_macro_p crashes when -ftrack-macro-expansion is on. The issue can be reproduced by running the tests: runtest --tool gcc --tool_opts="-ftrack-macro-expansion" cpp.exp=sysmac1.c runtest --tool gcc --tool_opts="-ftrack-macro-expansion" cpp.exp=sysmac2.c This is because it just doesn't support that mode. Fixed thus. Tested and bootstrapped on x86_64-unknown-linux-gnu against trunk. Note that the bootstrap with -ftrack-macro-expansion turned on exhibits other separate issues that are addressed in subsequent patches. This patch just fixes one class of problems. The patch does pass bootstrap with -ftrack-macro-expansion turned off, though. libcpp/ * macro.c (cpp_sys_macro_p): Support -ftrack-macro-expansion. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186965 138bc75d-0d04-0410-961f-82ee72b054a4
* Don't use C++ style comments in libcppdodji2012-04-292-2/+8
| | | | | | | | | | | | | | | I noticed that the file lex.c had C++ style comments, which I believe is against the coding standards of the project. Fixed, tested and applied to master as per the obvious rule. libcpp/ * lex.c (lex_raw_string): Change C++ style comments into C style comments. (lex_string): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186946 138bc75d-0d04-0410-961f-82ee72b054a4
* Add new option, -Wliteral-suffix.aaw2012-04-274-7/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This option, which is enabled by default, causes the preprocessor to warn when a string or character literal is followed by a ud-suffix which does not begin with an underscore. According to [lex.ext]p10, this is ill-formed. Also modifies the preprocessor to treat such ill-formed suffixes as separate preprocessing tokens. This is consistent with the Clang front end (see http://llvm.org/viewvc/llvm-project?view=rev&revision=152287), and enables backwards compatibility with code that uses formatting macros from <inttypes.h>, as in the following code block: int main() { int64_t i64 = 123; printf("My int64: %"PRId64"\n", i64); } Google ref b/6377711. 2012-04-27 Ollie Wild <aaw@google.com> PR c++/52538 * gcc/c-family/c-common.c: Add CPP_W_LITERAL_SUFFIX mapping. * gcc/c-family/c-opts.c (c_common_handle_option): Handle OPT_Wliteral_suffix. * gcc/c-family/c.opt: Add Wliteral-suffix. * gcc/doc/invoke.texi (Wliteral-suffix): Document new option. * gcc/testsuite/g++.dg/cpp0x/Wliteral-suffix.c: New test. * libcpp/include/cpplib.h (struct cpp_options): Add new field, warn_literal_suffix. (CPP_W_LITERAL_SUFFIX): New enum. * libcpp/init.c (cpp_create_reader): Default initialization of warn_literal_suffix. * libcpp/lex.c (lex_raw_string): Treat user-defined literals which don't begin with '_' as separate tokens and produce a warning. (lex_string): Ditto. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186909 138bc75d-0d04-0410-961f-82ee72b054a4
* 2012-04-26 Manuel López-Ibáñez <manu@gcc.gnu.org>manu2012-04-263-9/+19
| | | | | | | | | | | | | | * tree-diagnostic.c (maybe_unwind_expanded_macro_loc): Fix comment. Delete unused parameter first_exp_point_map. (virt_loc_aware_diagnostic_finalizer): Update call. libcpp/ * line-map.c (linemap_resolve_location): Synchronize comments with those in line-map.h. * include/line-map.h (linemap_resolve_location): Fix spelling in comment. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186860 138bc75d-0d04-0410-961f-82ee72b054a4
* * vi.po: Update.jsm282012-04-242-32/+37
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186786 138bc75d-0d04-0410-961f-82ee72b054a4
* * ja.po: Update.jsm282012-03-272-7/+10
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@185878 138bc75d-0d04-0410-961f-82ee72b054a4
* * lex.c (search_line_fast): Provide Neon-optimized version for ARM.rearnsha2012-03-222-0/+67
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@185702 138bc75d-0d04-0410-961f-82ee72b054a4
* * cpplib.pot: Regenerate.jsm282012-03-182-28/+32
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@185508 138bc75d-0d04-0410-961f-82ee72b054a4
* Remove obsolete Solaris 8 supportro2012-03-142-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | libstdc++-v3: * config/os/solaris/solaris2.8: Rename to ... * config/os/solaris/solaris2.9: ... this. * config/abi/post/solaris2.8: Rename to ... * config/abi/post/solaris2.9: ... this. * configure.host (os_include_dir): Remove solaris2.8. Reflect renaming. (abi_baseline_pair): Remove *-*-solaris2.8. Reflect renaming. * configure.ac (GLIBCXX_CHECK_MATH_PROTO): Remove (GLIBCXX_CHECK_STDLIB_PROTO): Remove. * acinclude.m4 (GLIBCXX_CHECK_MATH_PROTO): Remove (GLIBCXX_CHECK_STDLIB_PROTO): Remove. (GLIBCXX_CHECK_GTHREADS): Remove Solaris 8 handling. * crossconfig.m4 (GLIBCXX_CROSSCONFIG): Remove *-solaris2.8 handling. * configure: Regenerate. * config.h.in: Regenerate. * config/os/solaris/solaris2.9/os_defines.h (__CORRECT_ISO_CPP_MATH_H_PROTO): Define. (__CORRECT_ISO_CPP_STDLIB_H_PROTO): Define. * include/c_global/cmath: Rename __CORRECT_ISO_CPP_MATH_H_PROTO1 to __CORRECT_ISO_CPP_MATH_H_PROTO. [!__CORRECT_ISO_CPP_MATH_H_PROTO2]: Remove. * include/tr1/cmath: Rename __CORRECT_ISO_CPP_MATH_H_PROTO1 to __CORRECT_ISO_CPP_MATH_H_PROTO. * doc/xml/manual/configure.xml (Configure, --enable-libstdcxx-threads): Remove Solaris 8 reference. * testsuite/27_io/basic_istream/extractors_arithmetic/char/12.cc: Don't xfail on *-*-solaris2.8. * testsuite/27_io/basic_istream/extractors_arithmetic/wchar_t/12.cc: Likewise. * testsuite/ext/enc_filebuf/char/13598.cc: Don't xfail on *-*-solaris2.8. libjava: * configure.ac (THREADLIBS): Remove *-*-solaris2.8 handling. * configure: Regenerate. libgcc: * config/i386/sol2-unwind.h (x86_fallback_frame_state): Remove Solaris 8 handling. * config/sparc/sol2-unwind.h (sparc64_is_sighandler): Remove Solaris 8 handling. (sparc_is_sighandler): Likewise. libcpp: * lex.c: Remove Solaris 8 reference. gcc/testsuite: * g++.dg/warn/miss-format-1.C: Remove *-*-solaris2.8 handling. * gcc.dg/c99-stdint-6.c: Likewise. * gcc.dg/lto/20090210_0.c: Likewise. * gcc.dg/pr28796-2.c: Don't skip on sparc*-sun-solaris2.8. * gcc.dg/pragma-init-fini.c: Don't skip on i?86-*-solaris2.8. * gcc.dg/pragma-init-fini-2.c: Likewise. * gcc.dg/torture/pr47917.c: Remove *-*-solaris2.8 handling. * gcc.target/i386/pr22076.c: Remove i?86-*-solaris2.8 handling. * gcc.target/i386/pr22152.c: Likewise. * gcc.target/i386/vect8-ret.c: Likewise. * lib/target-supports.exp (add_options_for_tls): Remove Solaris 8 handling. gcc: * config.gcc (enable_obsolete): Remove *-*-solaris2.8*. (*-*-solaris2.[0-8], *-*-solaris2.[0-8].*): Mark unsupported. (i[34567]86-*-solaris2*, x86_64-*-solaris2.1[0-9]*): Remove Solaris 8 support. * configure.ac (gcc_cv_ld_hidden): Remove *-*-solaris2.8*. (ld_tls_support): Remove Solaris 8 references. (lwp_dir, lwp_spec): Remove support for alternate thread library. * acinclude.m4 (gcc_cv_initfini_array): Remove *-*-solaris2.* tests. * configure: Regenerate. * config.in: Regenerate. * config/sol2.h (LINK_SPEC): Remove LIB_THREAD_LDFLAGS_SPEC. * config/i386/sol2.h: Remove Solaris 8 references. * doc/install.texi (Specific, i?86-*-solaris2.[89]): Rename to ... (i?86-*-solaris2.9): ... this. Remove Solaris 8 references. (Specific, *-*-solaris2*): Document Solaris 8 removal. Remove Solaris 8 references. fixincludes: * inclhack.def (math_exception): Remove duplicate. (solaris_cond_init): Remove. (solaris_sys_va_list): Remove Solaris 8 support. * fixincl.x: Regenerate. * tests/base/pthread.h [SOLARIS_COND_INIT_CHECK]: Remove. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@185392 138bc75d-0d04-0410-961f-82ee72b054a4
* Add ports for TILE-Gx and TILEPro.walt2012-02-143-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | . * MAINTAINERS (tilegx port): Add myself. (tilepro port): Add myself. contrib * config-list.mk (LIST): Add tilegx-linux-gnu and tilepro-linux-gnu. * gcc_update (gcc/config/tilegx/mul-tables.c): New dependencies. (gcc/config/tilepro/mul-tables.c): New dependencies. gcc * config.gcc: Handle tilegx and tilepro. * configure.ac (gcc_cv_as_dwarf2_debug_line): Enable test for tilegx and tilepro. Add HAVE_AS_TLS check for tilegx and tilepro. * configure: Regenerate. * doc/contrib.texi: Add Mat Hostetter and self. * doc/extend.texi (TILE-Gx Built-in Functions): New node. Document instruction intrinsics and network accessing intrinsics. (TILEPro Built-in Functions): New node. Document instruction intrinsics and network accessing intrinsics. * doc/install.texi (Specific, tilegx-*-linux*): Document it. (Specific, tilepro-*-linux*): Likewise. * doc/invoke.texi (TILE-Gx Options): New section. (TILEPro Options): New section. * doc/md.texi (TILE-Gx): New section. (TILEPro): New section. * common/config/tilegx: New directory for tilegx. * common/config/tilepro: New directory for tilepro. * config/tilegx: New directory for tilegx. * config/tilepro: New directory for tilepro. gcc/testsuite * g++.dg/other/PR23205.C: Disable test on tile. * g++.dg/other/pr23205-2.C: Disable test on tile. * gcc.dg/20020312-2.c: Add a condition for __tile__. * gcc.dg/20040813-1.c: Disable test on tile. * gcc.dg/lower-subreg-1.c: Disable test on tilegx. * gcc.misc-tests/linkage.exp: Handle tilegx. libcpp * configure.ac: Require 64-bit hwint for tilegx and tilepro. * configure: Regenerate. libgcc * config.host: Handle tilegx and tilepro. * config/tilegx: New directory for tilegx. * config/tilepro: New directory for tilepro. libgomp * configure.tgt: Handle tilegx and tilepro. * config/linux/tile: New directory for tilegx and tilepro. Added: trunk/gcc/common/config/tilegx/tilegx-common.c trunk/gcc/common/config/tilepro/tilepro-common.c trunk/gcc/config/tilegx/constraints.md trunk/gcc/config/tilegx/linux.h trunk/gcc/config/tilegx/mul-tables.c trunk/gcc/config/tilegx/predicates.md trunk/gcc/config/tilegx/sync.md trunk/gcc/config/tilegx/t-tilegx trunk/gcc/config/tilegx/tilegx-builtins.h trunk/gcc/config/tilegx/tilegx-c.c trunk/gcc/config/tilegx/tilegx-generic.md trunk/gcc/config/tilegx/tilegx-modes.def trunk/gcc/config/tilegx/tilegx-multiply.h trunk/gcc/config/tilegx/tilegx-protos.h trunk/gcc/config/tilegx/tilegx.c trunk/gcc/config/tilegx/tilegx.h trunk/gcc/config/tilegx/tilegx.md trunk/gcc/config/tilegx/tilegx.opt trunk/gcc/config/tilepro/constraints.md trunk/gcc/config/tilepro/gen-mul-tables.cc trunk/gcc/config/tilepro/linux.h trunk/gcc/config/tilepro/mul-tables.c trunk/gcc/config/tilepro/predicates.md trunk/gcc/config/tilepro/t-tilepro trunk/gcc/config/tilepro/tilepro-builtins.h trunk/gcc/config/tilepro/tilepro-c.c trunk/gcc/config/tilepro/tilepro-generic.md trunk/gcc/config/tilepro/tilepro-modes.def trunk/gcc/config/tilepro/tilepro-multiply.h trunk/gcc/config/tilepro/tilepro-protos.h trunk/gcc/config/tilepro/tilepro.c trunk/gcc/config/tilepro/tilepro.h trunk/gcc/config/tilepro/tilepro.md trunk/gcc/config/tilepro/tilepro.opt trunk/libgcc/config/tilegx/sfp-machine.h trunk/libgcc/config/tilegx/sfp-machine32.h trunk/libgcc/config/tilegx/sfp-machine64.h trunk/libgcc/config/tilegx/t-crtstuff trunk/libgcc/config/tilegx/t-softfp trunk/libgcc/config/tilegx/t-tilegx trunk/libgcc/config/tilepro/atomic.c trunk/libgcc/config/tilepro/atomic.h trunk/libgcc/config/tilepro/linux-unwind.h trunk/libgcc/config/tilepro/sfp-machine.h trunk/libgcc/config/tilepro/softdivide.c trunk/libgcc/config/tilepro/softmpy.S trunk/libgcc/config/tilepro/t-crtstuff trunk/libgcc/config/tilepro/t-tilepro trunk/libgomp/config/linux/tile/futex.h Modified: trunk/MAINTAINERS trunk/contrib/config-list.mk trunk/contrib/gcc_update trunk/gcc/config.gcc trunk/gcc/configure trunk/gcc/configure.ac trunk/gcc/doc/contrib.texi trunk/gcc/doc/extend.texi trunk/gcc/doc/install.texi trunk/gcc/doc/invoke.texi trunk/gcc/doc/md.texi trunk/gcc/testsuite/g++.dg/other/PR23205.C trunk/gcc/testsuite/g++.dg/other/pr23205-2.C trunk/gcc/testsuite/gcc.dg/20020312-2.c trunk/gcc/testsuite/gcc.dg/20040813-1.c trunk/gcc/testsuite/gcc.dg/lower-subreg-1.c trunk/gcc/testsuite/gcc.misc-tests/linkage.exp trunk/libcpp/configure trunk/libcpp/configure.ac trunk/libgcc/config.host trunk/libgomp/configure.tgt git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@184203 138bc75d-0d04-0410-961f-82ee72b054a4
* * uk.po: Update.jsm282012-01-312-82/+57
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@183774 138bc75d-0d04-0410-961f-82ee72b054a4
* * es.po: Update.jsm282012-01-312-138/+140
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@183766 138bc75d-0d04-0410-961f-82ee72b054a4
* * be.po, ca.po, da.po, de.po, el.po, es.po, fi.po, fr.po, id.po,jsm282012-01-3019-2536/+2638
| | | | | | | | ja.po, nl.po, ru.po, sv.po, tr.po, uk,po, vi.po, zh_CN.po, zh_TW.po: Update. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@183744 138bc75d-0d04-0410-961f-82ee72b054a4
* gcc/po:jsm282012-01-272-148/+156
| | | | | | | | | | * gcc.pot: Regenerate. libcpp/po: * cpplib.pot: Regenerate. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@183634 138bc75d-0d04-0410-961f-82ee72b054a4
* 2012-01-09 Richard Guenther <rguenther@suse.de>rguenth2012-01-092-2/+4
| | | | | | | * macro.c (_cpp_builtin_macro_text): Remove unused variable map. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@183013 138bc75d-0d04-0410-961f-82ee72b054a4
* libcpp/gfunck2012-01-094-8/+24
| | | | | | | | | | | | | | | | | | | PR preprocessor/33919 * files.c (_cpp_get_file_name): New. Implement file name access function. * internal.h (_cpp_get_file_name): New prototype. * macro.c (_cpp_builtin_macro_text): Call _cpp_get_file_name() to use pfile->main_file in lieu of traversing INCLUDED_FROM chain. gcc/testsuite/ PR preprocessor/33919 * gcc.dg/pr33919.c: New test. * gcc.dg/pr33919-0.h: New test header file. * gcc.dg/pr33919-1.h: Ditto. * gcc.dg/pr33919-2.h: Ditto. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@183003 138bc75d-0d04-0410-961f-82ee72b054a4
* gcc/hainque2012-01-032-0/+12
| | | | | | | | | | | * system.h: Prior to #define, #undef fopen and freopen unconditionally. libcpp/ * system.h: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@182837 138bc75d-0d04-0410-961f-82ee72b054a4
* gcc:jsm282011-12-203-7/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * c-decl.c (diagnose_mismatched_decls, grokdeclarator, grokfield) (finish_struct): Refer to C11 in comments. Use flag_isoc11. * c-parser.c (c_parser_static_assert_declaration) (c_parser_static_assert_declaration_no_semi, c_parser_declspecs) (c_parser_alignas_specifier, c_parser_alignof_expression): Refer to C11 in comments. Use flag_isoc11. * c-typeck.c (comptypes_check_different_types): Refer to C11 in comment. * doc/cpp.texi (Overview): Refer to -std=c11 instead of -std=c1x. * doc/cppopts.texi (-std=c11, -std=gnu11): Document in preference to -std=c1x and -std=gnu1x. * doc/extend.texi (Inline, Alternate Keywords, Other Builtins) (__builtin_complex, Unnamed Fields): Refer to -std=c11 and C11 instead of -std=c1x and C1X. * doc/invoke.texi (-std=c11, -std=iso9899:2011): Document in preference to -std=c1x. (-std=gnu11): Document in preference to -std=gnu1x. * doc/standards.texi: Document C11 instead of C1X. Document C11 as actual standard. Document headers required from freestanding C11 implementations. * ginclude/float.h, ginclude/stddef.h: Test __STDC_VERSION__ >= 201112L for C11. Update comments to refer to C11. gcc/c-family: * c-common.c (flag_isoc99): Update comment to refer to C11. (flag_isoc1x): Change to flag_isoc11. * c-common.h (flag_isoc99): Update comment to refer to C11. (flag_isoc1x): Change to flag_isoc11. * c-cppbuiltin.c (cpp_atomic_builtins): Change comment to refer to C11. * c-opts.c (set_std_c1x): Change to set_std_c11. (c_common_handle_option): Handle OPT_std_c11 and OPT_std_gnu11. Call set_std_c11. (set_std_c89, set_std_c99, set_std_c11): Use flag_isoc11. (set_std_c1): Use CLK_STDC11 and CLK_GNUC11. * c.opt (std=c1x): Change to std=c11. Document as non-draft standard. (std=c1x, std=iso9899:2011): Add as aliases of std=c11. (std=gnu1x): Change to std=gnu11. Refer to non-draft standard. (std=gnu1x): Make alias of std=gnu11. gcc/testsuite: * gcc.dg/c11-version-1.c, gcc.dg/c11-version-2.c, gcc.dg/c94-version-1.c, gcc.dg/c99-version-1.c, gcc.dg/gnu11-version-1.c: New tests. libcpp: * include/cpplib.h (CLK_GNUC1X): Change to CLK_GNUC11. (CLK_STDC1X): Change to CLK_STDC11. * init.c (lang_defaults): Update comments. (cpp_init_builtins): Update language tests. Use 201112L for C11 __STDC_VERSION__. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@182551 138bc75d-0d04-0410-961f-82ee72b054a4
* config/:schwab2011-12-202-3/+7
| | | | | | | | | | | | | | | | | | | | * warnings.m4 (ACX_PROG_CC_WARNING_OPTS): Avoid leading dash in expr call. fixincludes/: * configure: Regenerate. gcc/: * configure: Regenerate. libcpp/: * configure: Regenerate. libdecnumber/: * configure: Regenerate. libiberty/: * configure: Regenerate. lto-plugin/: * configure: Regenerate. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@182546 138bc75d-0d04-0410-961f-82ee72b054a4
* Check for warning flags without no- prefixschwab2011-12-192-15/+39
| | | | | | | | | | | | | | | | | | | | | | | config/: PR bootstrap/51388 * warnings.m4 (ACX_PROG_CC_WARNING_OPTS) (ACX_PROG_CC_WARNING_ALMOST_PEDANTIC): Run the test without the no- prefix. fixincludes/: * configure: Regenerate. gcc/: * configure: Regenerate. libcpp/: * configure: Regenerate. libdecnumber/: * configure: Regenerate. libiberty/: * configure: Regenerate. lto-plugin/: * configure: Regenerate. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@182478 138bc75d-0d04-0410-961f-82ee72b054a4
* PR bootstrap/50237jakub2011-12-074-1/+25
| | | | | | | | | | | | * internal.h (_cpp_init_lexer): New prototype. * init.c (init_library): Call it. * lex.c (init_vectorized_lexer): Remove constructor attribute, add inline keyword. (HAVE_init_vectorized_lexer): Define. (_cpp_init_lexer): New function. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@182090 138bc75d-0d04-0410-961f-82ee72b054a4
* Add 'inline' to prototype of tokens_buff_remove_last_tokendodji2011-12-052-8/+14
| | | | | | | | | | libcpp/ * macro.c (tokens_buff_remove_last_token) (tokens_buff_put_token_to): Add an 'inline' function specifier to the prototype. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@182002 138bc75d-0d04-0410-961f-82ee72b054a4
* * include/line-map.h (linemap_dump): Declare.dnovillo2011-11-223-0/+107
| | | | | | | | (line_table_dump): Declare. * line-map.c (linemap_dump): New. (line_table_dump): New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@181625 138bc75d-0d04-0410-961f-82ee72b054a4
* PR c++/50958jason2011-11-212-2/+7
| | | | | | | | | | | | gcc/cp/ * parser.c (lookup_literal_operator): New. (cp_parser_userdef_char_literal): Use it. (cp_parser_userdef_numeric_literal): Use it. (cp_parser_userdef_string_literal): Use lookup_name. libcpp/ * expr.c (cpp_userdef_char_remove_type): Fix typo. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@181595 138bc75d-0d04-0410-961f-82ee72b054a4
* libcpp/matz2011-11-034-1/+57
| | | | | | | | | | | | | | | | | | PR bootstrap/50857 * configure.ac: Check for -fno-exceptions -fno-rtti. * configure: Regenerate. * Makefile.in (NOEXCEPTION_FLAGS): New flag. (ALL_CXXFLAGS): Use it. gcc/ PR bootstrap/50857 * configure.ac: Check for -fno-exceptions -fno-rtti. * configure: Regenerate. * Makefile.in (NOEXCEPTION_FLAGS): New flag. (ALL_CXXFLAGS): Use it. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@180833 138bc75d-0d04-0410-961f-82ee72b054a4
* 2011-11-02 Paolo Carlini <paolo.carlini@oracle.com>paolo2011-11-022-6/+10
| | | | | | | * internal.h (uxstrdup, ustrchr): Return const unsigned char *. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@180796 138bc75d-0d04-0410-961f-82ee72b054a4
* PR c++/50810jason2011-11-023-2/+7
| | | | | | | | | | | | | | | | | | | gcc/c-family * c-opts.c (c_common_handle_option): Enable -Wnarrowing as part of -Wall; include -Wnarrowing in -Wc++0x-compat; adjust default Wnarrowing for C++0x and C++98. * c.opt ([Wnarrowing]): Update. gcc/cp * typeck2.c (check_narrowing): Adjust OPT_Wnarrowing diagnostics. (digest_init_r): Call check_narrowing irrespective of the C++ dialect. * decl.c (check_initializer): Likewise. * semantics.c (finish_compound_literal): Likewise. gcc/ * configure.ac: Add -Wno-narrowing to warning options. libcpp/ * configure.ac: Add -Wno-narrowing to warning options. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@180794 138bc75d-0d04-0410-961f-82ee72b054a4
* PR libstdc++/1773jason2011-10-312-1/+10
| | | | | | * init.c (cpp_init_builtins): Set __cplusplus for C++11. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@180708 138bc75d-0d04-0410-961f-82ee72b054a4
* PR c++/50920jason2011-10-313-5/+11
| | | | | | | | | | | | | | | | | | | | gcc/c-family * c-common.h (cxx_dialect): Add cxx11 and cxx03. * c.opt: Add -std=c++11, -std=gnu++11, -std=gnu++03, and -Wc++11-compat. * c-opts.c (set_std_cxx11): Rename from set_std_cxx0x. gcc/cp * class.c (check_field_decl): Change c++0x in diags to c++11. * error.c (maybe_warn_cpp0x): Likewise. * parser.c (cp_parser_diagnose_invalid_type_name): Likewise. * pt.c (check_default_tmpl_args): Likewise. libcpp * include/cpplib.h (enum c_lang): Rename CLK_CXX0X to CLK_CXX11, CLK_GNUCXX0X to CLK_GNUCXX11. libstdc++-v3 * include/bits/c++0x_warning.h: Change -std=c++0x to -std=c++11. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@180707 138bc75d-0d04-0410-961f-82ee72b054a4
* Implement C++11 user-defined literals.jason2011-10-265-28/+270
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | libcpp/ * expr.c: (cpp_interpret_float_suffix, cpp_interpret_int_suffix, cpp_userdef_string_remove_type, cpp_userdef_string_add_type, cpp_userdef_char_remove_type, cpp_userdef_char_add_type, cpp_userdef_string_p, cpp_userdef_char_p, cpp_get_userdef_suffix): New. (cpp_classify_number): Classify unrecognized tokens as user-defined literals. * include/cpplib.h: Add new tokens for user-defined literals. * init.c: Add new preprocessor flag (cxx11). * lex.c: (lex_string, lex_raw_string): Handle user-defined literals including concatenation and promotion with suffixes. c-family/ * c-common.c (build_userdef_literal): New. * c-common.def: New tree code. * c-common.h (tree_userdef_literal): New tree struct and accessors. * c-lex.c (interpret_float): Add suffix parm. (c_lex_with_flags): Build literal tokens. cp/ * cp-objcp-common.c: (cp_tree_size) Return size of USERDEF_LITERAL tree. * cp-tree.h: (UDLIT_OP_*, UDLIT_OPER_P): Literal operator name tools. New tree code for user-defined literals. * cxx-pretty-print.h: (pp_cxx_userdef_literal) New. * cxx-pretty-print.c: (pp_cxx_userdef_literal) New. (pp_cxx_primary_expression, pp_cxx_expression): Use it. * decl.c: (cp_tree_node_structure): Return new tree code. (duplicate_decls): Check for raw vs. template operator conflicts. (grokfndecl, grokdeclarator): New checks for literal operators. * error.c: (dump_expr): Warn about user-defined literals in C++98 mode. (dump_function_name): Pretty printing. * mangle.c: (write_literal_operator_name): New. (write_unqualified_id, write_unqualified_name): Use it. * parser.c: (cp_parser_operator): Handle operator"". (cp_parser_userdef_char_literal, cp_parser_userdef_numeric_literal, cp_parser_userdef_string_literal): New. (cp_parser_primary_expression): Handle new user-defined literal tokens with new functions. * semantics.c: (potential_constant_expression_1): Add user-defined literals. * typeck.c (check_raw_literal_operator, check_literal_operator_args): New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@180536 138bc75d-0d04-0410-961f-82ee72b054a4
* Fix lookup of macro mapsdodji2011-10-252-3/+7
| | | | | | * line-map.c (linemap_macro_map_lookup): Fix logic. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@180427 138bc75d-0d04-0410-961f-82ee72b054a4