// Bug c++/83871 - wrong code due to attributes on distinct template // specializations // Test to verify that an explicit template specifialization does not // "inherit" attribute deprecated from a primary template declared // with it. // { dg-do compile } // { dg-options "-Wall -fdump-tree-optimized" } struct Special; template void fdeprecated_primary (); // The primary isn't deprecated at this point so the declaration // of its specialization should not be diagnosed. template <> void fdeprecated_primary (); // { dg-bogus "deprecated" } template void __attribute__ ((deprecated)) fdeprecated_primary (); void use_primary () { // Verify that uses of the now deprecacted primary are diagnosed. fdeprecated_primary(); // { dg-warning "deprecated" "bug 84542" } fdeprecated_primary(); // { dg-warning "deprecated" "bug 84542" } } void use_special () { // Verify that the use of the non-deprecated specializatoin // is not diagnosed. fdeprecated_primary(); }