[Bug c++/60642] Unclear diagnostic with invalid use of abi_tag attribute on explicit instantiation

2014-04-01 Thread jason at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60642

--- Comment #5 from Jason Merrill jason at gcc dot gnu.org ---
Author: jason
Date: Tue Apr  1 17:49:38 2014
New Revision: 208992

URL: http://gcc.gnu.org/viewcvs?rev=208992root=gccview=rev
Log:
PR c++/60642
* decl2.c (is_late_template_attribute): Don't defer abi_tag.
* mangle.c (write_unqualified_name): Fix abi_tag on templates.
* pt.c (get_template_info): Handle NAMESPACE_DECL.
(most_general_template): Handle more kinds of template.
* tree.c (handle_abi_tag_attribute): Ignore abi_tag on template
instantiations and specializations.

Added:
trunk/gcc/testsuite/g++.dg/abi/abi-tag6.C
trunk/gcc/testsuite/g++.dg/abi/abi-tag7.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/decl2.c
trunk/gcc/cp/mangle.c
trunk/gcc/cp/pt.c
trunk/gcc/cp/tree.c
trunk/gcc/doc/extend.texi
trunk/gcc/testsuite/g++.dg/abi/abi-tag3.C


[Bug c++/60642] Unclear diagnostic with invalid use of abi_tag attribute on explicit instantiation

2014-04-01 Thread jason at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60642

Jason Merrill jason at gcc dot gnu.org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED
   Target Milestone|--- |4.9.0

--- Comment #6 from Jason Merrill jason at gcc dot gnu.org ---
Fixed for 4.9.  The compiler will now just warn that the attribute on the
explicit instantiation is ignored, and correctly emit the tag on
instantiations.


[Bug c++/60642] Unclear diagnostic with invalid use of abi_tag attribute on explicit instantiation

2014-03-27 Thread jason at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60642

Jason Merrill jason at gcc dot gnu.org changed:

   What|Removed |Added

   Keywords||ABI
 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |jason at gcc dot gnu.org


[Bug c++/60642] Unclear diagnostic with invalid use of abi_tag attribute on explicit instantiation

2014-03-26 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60642

Jonathan Wakely redi at gcc dot gnu.org changed:

   What|Removed |Added

 CC||jason at gcc dot gnu.org

--- Comment #4 from Jonathan Wakely redi at gcc dot gnu.org ---
(In reply to Luke Allardyce from comment #3)
 On further inspection it looks like vtable symbols for template classes are
 not being tagged

Let's ask Jason to take a look at that.


[Bug c++/60642] Unclear diagnostic with invalid use of abi_tag attribute on explicit instantiation

2014-03-25 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60642

Jonathan Wakely redi at gcc dot gnu.org changed:

   What|Removed |Added

   Keywords||diagnostic
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2014-03-25
Summary|abi_tag attribute doesn't   |Unclear diagnostic with
   |work on explicit|invalid use of abi_tag
   |specializations of class|attribute on explicit
   |templates   |instantiation
 Ever confirmed|0   |1

--- Comment #1 from Jonathan Wakely redi at gcc dot gnu.org ---
That's not a specialization, it's an explicit instantiation, and so you don't
need the tag, it should be simply:

template class testint;

The error message could be clearer though, so confirming as a diagnostic bug.


[Bug c++/60642] Unclear diagnostic with invalid use of abi_tag attribute on explicit instantiation

2014-03-25 Thread lukeallardyce at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60642

--- Comment #2 from Luke Allardyce lukeallardyce at gmail dot com ---
I thought the symbols weren't being mangled with the attribute on the
instantiation without the extra tag, but as it turns out they are, sorry.


[Bug c++/60642] Unclear diagnostic with invalid use of abi_tag attribute on explicit instantiation

2014-03-25 Thread lukeallardyce at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60642

--- Comment #3 from Luke Allardyce lukeallardyce at gmail dot com ---
On further inspection it looks like vtable symbols for template classes are not
being tagged

struct __attribute((abi_tag(test))) foo 
{ 
  void f(); 
  virtual ~foo(); 
};

templatetypename
struct __attribute((abi_tag(test))) bar
{ 
  void f(); 
  virtual ~bar();
};

extern template class barint;

int main()
{
  foo f;
  f.f();

  barint b;
  b.f();
}

$ g++ test.cpp -c
$ nm test.o 

0108 s EH_frame1
00c2 s GCC_except_table0
 U __Unwind_Resume
 U __ZN3barB4testIiE1fEv
00a6 S __ZN3barB4testIiEC1Ev
 U __ZN3barB4testIiED1Ev
 U __ZN3fooB4test1fEv
008a S __ZN3fooB4testC1Ev
 U __ZN3fooB4testD1Ev
 U __ZTV3barIiE
 U __ZTV3fooB4test
 U ___gxx_personality_v0
 T _main