This is a compilation error. In order to help determine what could be causing this we would need to see self-contained, buildable source code, as well as the exact command line used to invoke nvcc.
Given that CUDA 6.0 shipped several months ago, you may want to consider upgrading to that. There may have been a compiler bug in CUDA 5.0 (pure conjecture at this point), and if so, it may have been fixed in later versions of the CUDA tool chain.