Since r7-2549 we were throwing away the explicit C:: when we found that ~C
has an attribute that we treat as making its type dependent.
PR c++/108795
gcc/cp/ChangeLog:
* semantics.cc (finish_id_expression_1): Check scope before
returning id_expression.
gcc/testsuite/ChangeLog:
* g++.dg/ext/attr-tsafe1.C: New test.
: CP_ID_KIND_UNQUALIFIED)));
if (dependent_p
+ && !scope
&& DECL_P (decl)
&& any_dependent_type_attributes_p (DECL_ATTRIBUTES (decl)))
/* Dependent type attributes on the decl mean that the TREE_TYPE is
--- /dev/null
+// PR c++/108795
+
+template <typename T> void g (T x)
+{
+ struct C
+ {
+ __attribute__((transaction_safe)) ~C();
+ };
+ C::~C(); // { dg-error "" }
+}
+void f ()
+{
+ g (5);
+}