I can duplicate your problem with the original release of Studio 12.1 (C++ 5.10).
The current patch of Studio 12.1 compiles the test case without a problem.
The original releases of Studio 12.2 and 12.3 (C++ 5.11 and 5.12) also compile the test case.
If you have a service contract for Studio with Oracle, you can download patches from My Oracle Support. (Patches are available only with a service contract.)
Otherwise, you can fix this problem by upgrading to a newer release. If upgrading the compiler is an option, I recommend getting Studio 12.3, the current release, in preference to patching an older release.
You can download releases here at no cost: