In vhdl-mode, TAB is bound to vhdl-electric-tab. This function tries to indent code correctly.
When I hit TAB with code selected when cua-mode is enabled, the selected code is replaced with tab instead of being indented.
If I instead run M-x vhdl-electric-tab, the code is indented as expected.
If I bind vhdl-electric-tab to e.g. f8, I get the same problem.
What is the problem here?