aboutsummaryrefslogtreecommitdiff
path: root/gcc/c
diff options
context:
space:
mode:
authorMartin Uecker <muecker@gwdg.de>2020-11-26 08:12:12 +0100
committerMartin Uecker <muecker@gwdg.de>2020-11-26 08:22:38 +0100
commit768ce4f0ceb030e38427e85e483ed44330cd5da7 (patch)
tree62d7ca90f39ead505ccca0416451442db50b3c0e /gcc/c
parent8f81f43f606cd915e96c857c007a4635fc0ea601 (diff)
downloadgcc-768ce4f0ceb030e38427e85e483ed44330cd5da7.zip
gcc-768ce4f0ceb030e38427e85e483ed44330cd5da7.tar.gz
gcc-768ce4f0ceb030e38427e85e483ed44330cd5da7.tar.bz2
C: Do not drop qualifiers in typeof for _Atomic types. [PR65455,PR92935]
2020-11-25 Martin Uecker <muecker@gwdg.de> gcc/c/ PR c/65455 PR c/92935 * c-parser.c (c_parser_declaration_or_fndef): Remove redundant code to drop qualifiers of _Atomic types for __auto_type. (c_parser_typeof_specifier): Do not drop qualifiers of _Atomic types for __typeof__. gcc/ PR c/65455 PR c/92935 * ginclude/stdatomic.h: Use comma operator to drop qualifiers. gcc/testsuite/ PR c/65455 PR c/92935 * gcc.dg/typeof-2.c: Adapt test.
Diffstat (limited to 'gcc/c')
-rw-r--r--gcc/c/c-parser.c9
1 files changed, 0 insertions, 9 deletions
diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c
index d86098a..87ee8f4 100644
--- a/gcc/c/c-parser.c
+++ b/gcc/c/c-parser.c
@@ -2224,10 +2224,6 @@ c_parser_declaration_or_fndef (c_parser *parser, bool fndef_ok,
" initializer");
init = convert_lvalue_to_rvalue (init_loc, init, true, true);
tree init_type = TREE_TYPE (init.value);
- /* As with typeof, remove all qualifiers from atomic types. */
- if (init_type != error_mark_node && TYPE_ATOMIC (init_type))
- init_type
- = c_build_qualified_type (init_type, TYPE_UNQUALIFIED);
bool vm_type = variably_modified_type_p (init_type,
NULL_TREE);
if (vm_type)
@@ -3743,11 +3739,6 @@ c_parser_typeof_specifier (c_parser *parser)
if (was_vm)
ret.expr = c_fully_fold (expr.value, false, &ret.expr_const_operands);
pop_maybe_used (was_vm);
- /* For use in macros such as those in <stdatomic.h>, remove all
- qualifiers from atomic types. (const can be an issue for more macros
- using typeof than just the <stdatomic.h> ones.) */
- if (ret.spec != error_mark_node && TYPE_ATOMIC (ret.spec))
- ret.spec = c_build_qualified_type (ret.spec, TYPE_UNQUALIFIED);
}
parens.skip_until_found_close (parser);
return ret;