Python bindings: Restore handling of deprecated constructs.
Needs ReviewPublic

Authored by shaheed on Feb 8 2017, 6:43 PM.

Details

Reviewers
skelly
Group Reviewers
Frameworks
Build System
Test Plan

Add to the unit tests and verify the result is marked with the expected annotations:

$ tail  ./tests/GenerateSipBindings/sip/PyTest/CppLib/cpplib.sip
...
class DeprecatedClass /Deprecated/
{
%TypeHeaderCode
#include <cpplib.h>
%End
public:
    void deprecatedFn(int bar) /Deprecated/;
};

Diff Detail

Repository
R240 Extra CMake Modules
Lint
Lint Skipped
Unit
Unit Tests Skipped
shaheed updated this revision to Diff 11083.Feb 8 2017, 6:43 PM
shaheed retitled this revision from to Python bindings: Restore handling of deprecated constructs..
shaheed updated this object.
shaheed edited the test plan for this revision. (Show Details)
shaheed set the repository for this revision to R240 Extra CMake Modules.
Restricted Application added projects: Frameworks, Build System. · View Herald TranscriptFeb 8 2017, 6:43 PM
Restricted Application added subscribers: Build System, Frameworks. · View Herald Transcript
skelly added inline comments.Feb 12 2017, 7:38 PM
find-modules/sip_generator.py
172

It was possible to handle exports without looking for the text EXPORT in the MACRO NAME. Why is deprecated different?

shaheed added inline comments.Feb 12 2017, 9:08 PM
find-modules/sip_generator.py
172

Because the expansion of the attribute in this case contains not a string, but a compiler reserved value

__deprecated__

in the case of clang. I am not aware of a portable way to know what the expansion is, so the choice was between a string compare of the clang spelling, or the original. The latter seemed somewhat more reliable to me. IIRC, my original code did the same for the EXPORT stuff (I know you changed it and to be honest, I think that was suboptimal for the same reason, but at least the text appears as "hidden" not an opaque reserved value).