diff options
author | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2017-01-16 09:09:30 +0000 |
---|---|---|
committer | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2017-01-16 09:09:30 +0000 |
commit | 231589dea440443b5adc7a7d2abbb337773b5a93 (patch) | |
tree | 736e048357146c99ea7cf08124c6ce193a9ebca7 /gcc/c-family | |
parent | be32d0c591c2c10d37ac66817d6c0f23d1b0357c (diff) | |
download | gcc-231589dea440443b5adc7a7d2abbb337773b5a93.tar.gz |
/c-family
2017-01-16 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/71737
* c-common.c (set_underlying_type): Always set DECL_ORIGINAL_TYPE.
/testsuite
2017-01-16 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/71737
* g++.dg/cpp0x/pr71737.C: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@244486 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-family')
-rw-r--r-- | gcc/c-family/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/c-family/c-common.c | 16 |
2 files changed, 14 insertions, 7 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index 774ca4e0eda..525a73f93aa 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,8 @@ +2017-01-16 Paolo Carlini <paolo.carlini@oracle.com> + + PR c++/71737 + * c-common.c (set_underlying_type): Always set DECL_ORIGINAL_TYPE. + 2017-01-12 Martin Sebor <msebor@redhat.com> (-Wformat-overflow): ...to this. diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c index 15ead18d36d..085bea03ac4 100644 --- a/gcc/c-family/c-common.c +++ b/gcc/c-family/c-common.c @@ -7419,16 +7419,18 @@ set_underlying_type (tree x) if (TYPE_NAME (TREE_TYPE (x)) == 0) TYPE_NAME (TREE_TYPE (x)) = x; } - else if (TREE_TYPE (x) != error_mark_node - && DECL_ORIGINAL_TYPE (x) == NULL_TREE) + else if (DECL_ORIGINAL_TYPE (x) == NULL_TREE) { tree tt = TREE_TYPE (x); DECL_ORIGINAL_TYPE (x) = tt; - tt = build_variant_type_copy (tt); - TYPE_STUB_DECL (tt) = TYPE_STUB_DECL (DECL_ORIGINAL_TYPE (x)); - TYPE_NAME (tt) = x; - TREE_USED (tt) = TREE_USED (x); - TREE_TYPE (x) = tt; + if (tt != error_mark_node) + { + tt = build_variant_type_copy (tt); + TYPE_STUB_DECL (tt) = TYPE_STUB_DECL (DECL_ORIGINAL_TYPE (x)); + TYPE_NAME (tt) = x; + TREE_USED (tt) = TREE_USED (x); + TREE_TYPE (x) = tt; + } } } |