http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58305
Bug ID: 58305 Summary: Deprecation warning for class not raised when not assigning to a variable Product: gcc Version: 4.6.3 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: languitar at semipol dot de Deprecation warnings for classes do not work in case the class is used but not assigned to a variable. The following code snippet illustrates the error: class ToBeDeprecated { } __attribute__ ((deprecated ("deprecated!"))); ToBeDeprecated() Despite using the class, no deprecation warning is shown. If I change the use to ToBeDeprecated x; a warning is shown.