aboutsummaryrefslogtreecommitdiff
path: root/gcc/stack-ptr-mod.c
diff options
context:
space:
mode:
authorPatrick Palka <ppalka@redhat.com>2020-08-04 10:11:35 -0400
committerPatrick Palka <ppalka@redhat.com>2020-08-04 10:11:35 -0400
commit843710c037c1396dcdbc23e5b6b456b8ae6e2b8b (patch)
tree75dae029db26c025f3c25904c70b1cec9057bd9e /gcc/stack-ptr-mod.c
parent1af5cdd77985daf76130f527deac425c43df9f49 (diff)
downloadgcc-843710c037c1396dcdbc23e5b6b456b8ae6e2b8b.zip
gcc-843710c037c1396dcdbc23e5b6b456b8ae6e2b8b.tar.gz
gcc-843710c037c1396dcdbc23e5b6b456b8ae6e2b8b.tar.bz2
c++: Member initializer list diagnostic locations [PR94024]
This patch preserves the source locations of each node in a member initializer list so that during processing of the list we can set input_location appropriately for generally more accurate diagnostic locations. Since TREE_LIST nodes are tcc_exceptional, they can't have source locations, so we instead store the location in a dummy tcc_expression node within the TREE_TYPE of the list node. gcc/cp/ChangeLog: PR c++/94024 * init.c (sort_mem_initializers): Preserve TREE_TYPE of the member initializer list node. (emit_mem_initializers): Set input_location when performing each member initialization. * parser.c (cp_parser_mem_initializer): Attach the source location of this initializer to a dummy EMPTY_CLASS_EXPR within the TREE_TYPE of the list node. * pt.c (tsubst_initializer_list): Preserve TREE_TYPE of the member initializer list node. gcc/testsuite/ChangeLog: PR c++/94024 * g++.dg/diagnostic/mem-init1.C: New test.
Diffstat (limited to 'gcc/stack-ptr-mod.c')
0 files changed, 0 insertions, 0 deletions