C++: add test for anonymous with __attribute__

Change-Id: I1938ed1bf45523ec62f35bc3324f6553c0dafe22
Sanity-Review: Qt Sanity Bot <qt_sanitybot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>