Bug 71712 - Redundant ABI tags for conversion operator
Summary: Redundant ABI tags for conversion operator
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: unknown
: P3 normal
Target Milestone: 7.0
Assignee: Jason Merrill
URL:
Keywords: ABI
Depends on:
Blocks:
 
Reported: 2016-06-30 08:45 UTC by Dmitry Polukhin
Modified: 2016-08-09 17:01 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2016-06-30 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitry Polukhin 2016-06-30 08:45:29 UTC
Reproducer:
struct __attribute__((abi_tag("A", "B"))) A { };
struct A18 {
  operator A() { return A(); }
};
void f18_test() {
  A a = A18();
}

Mangling for 'A18::operator A' is '_ZN3A18cv1AB1AB1BB1AB1Bev' pretty printed as ' A18::operator A[abi:A][abi:B][abi:A][abi:B]()' i.e. the same tags mentioned twice for the name. It seems that GCC adds implicit tags from the return type of the function but in all other cases they are added only if the tags are missing otherwise in the mangled name that is not the case in given example.
Comment 1 Jason Merrill 2016-08-09 16:55:40 UTC
Author: jason
Date: Tue Aug  9 16:55:08 2016
New Revision: 239299

URL: https://gcc.gnu.org/viewcvs?rev=239299&root=gcc&view=rev
Log:
	PR c++/71712 - ABI tags on conversion ops.

	* class.c (check_abi_tags): Don't duplicate tags for conversion ops.

Added:
    trunk/gcc/testsuite/g++.dg/abi/abi-tag22.C
    trunk/gcc/testsuite/g++.dg/abi/abi-tag22a.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/class.c
    trunk/gcc/cp/mangle.c
Comment 2 Jason Merrill 2016-08-09 17:01:52 UTC
Fixed for GCC 7.