Repository: opencv
Issue: Fails to compile "hal_internal.cpp"
Labels: bug,category: core,category: build/install

##### System information (version)
- OpenCV => 3.4.1
- Operating System / Platform => CentOs & Redhat 7.4 64 Bit
- Compiler => g++ 5.5 
- Compilation by Linuxbrew with all default settings

##### Detailed description

Compilation fails when reaches "hal_internal.cpp".
Note, two "complex" header files are included in "hal_internal.cpp": 
"complex.h" and "complex" 


```
/tmp/opencv-20180409-18036-14evg85/opencv-3.4.1/modules/core/src/hal_internal.cpp: In instantiation of 'int lapack_gemm_c(const fptype*, size_t, const fptype*, size_t, fptype, const fptype*, size_t, fptype, fptype*, size_t, int, int, int, int) [with fptype = float; size_t = long unsigned int]':
/tmp/opencv-20180409-18036-14evg85/opencv-3.4.1/modules/core/src/hal_internal.cpp:592:119:   required from here
/tmp/opencv-20180409-18036-14evg85/opencv-3.4.1/modules/core/src/hal_internal.cpp:440:9: warning: unused variable 'ldsrc3' [-Wunused-variable]
     int ldsrc3 = (int)(src3_step / sizeof(std::complex<fptype>));
         ^
/tmp/opencv-20180409-18036-14evg85/opencv-3.4.1/modules/core/src/hal_internal.cpp:435:98: warning: unused parameter 'alpha' [-Wunused-parameter]
 lapack_gemm_c(const fptype *src1, size_t src1_step, const fptype *src2, size_t src2_step, fptype alpha,
                                                                                                  ^
/tmp/opencv-20180409-18036-14evg85/opencv-3.4.1/modules/core/src/hal_internal.cpp: In instantiation of 'int lapack_gemm_c(const fptype*, size_t, const fptype*, size_t, fptype, const fptype*, size_t, fptype, fptype*, size_t, int, int, int, int) [with fptype = double; size_t = long unsigned int]':
/tmp/opencv-20180409-18036-14evg85/opencv-3.4.1/modules/core/src/hal_internal.cpp:599:119:   required from here
/tmp/opencv-20180409-18036-14evg85/opencv-3.4.1/modules/core/src/hal_internal.cpp:440:9: warning: unused variable 'ldsrc3' [-Wunused-variable]
     int ldsrc3 = (int)(src3_step / sizeof(std::complex<fptype>));
         ^
             copy_matrix((std::complex<fptype>*)src3, ldsrc3, (std::complex<fptype>*)dst, lddst, c_m, c_n);
                               ^
/tmp/opencv-20180409-18036-14evg85/opencv-3.4.1/modules/core/src/hal_internal.cpp:497:31: **error**: expected ')' before '_Complex'
/tmp/opencv-20180409-18036-14evg85/opencv-3.4.1/modules/core/src/hal_internal.cpp:502:25: **error**: expected unqualified-id before '_Complex'
         set_value((std::complex<fptype>*)dst, lddst, std::complex<fptype>(0.0, 0.0), d_m, d_n);
                         ^
/tmp/opencv-20180409-18036-14evg85/opencv-3.4.1/modules/core/src/hal_internal.cpp:502:25: **error**: expected ')' before '_Complex'
/tmp/opencv-20180409-18036-14evg85/opencv-3.4.1/modules/core/src/hal_internal.cpp:505:106: **error**: 'cAlpha' was not declared in this scope
         cblas_cgemm(CblasRowMajor, transA, transB, a_m, d_n, a_n, (float*)reinterpret_cast<fptype(&)[2]>(cAlpha), (float*)src1, ldsrc1, (float*)src2, ldsrc2, (float*)reinterpret_cast<fptype(&)[2]>(cBeta), (float*)dst, lddst);
                                                                                                          ^
/tmp/opencv-20180409-18036-14evg85/opencv-3.4.1/modules/core/src/hal_internal.cpp:505:198: **error**: 'cBeta' was not declared in this scope
         cblas_cgemm(CblasRowMajor, transA, transB, a_m, d_n, a_n, (float*)reinterpret_cast<fptype(&)[2]>(cAlpha), (float*)src1, ldsrc1, (float*)src2, ldsrc2, (float*)reinterpret_cast<fptype(&)[2]>(cBeta), (float*)dst, lddst);
                                                                                                                                                                                                      ^
/tmp/opencv-20180409-18036-14evg85/opencv-3.4.1/modules/core/src/hal_internal.cpp:507:107: **error**: 'cAlpha' was not declared in this scope
         cblas_zgemm(CblasRowMajor, transA, transB, a_m, d_n, a_n, (double*)reinterpret_cast<fptype(&)[2]>(cAlpha), (double*)src1, ldsrc1, (double*)src2, ldsrc2, (double*)reinterpret_cast<fptype(&)[2]>(cBeta), (double*)dst, lddst);
                                                                                                           ^
/tmp/opencv-20180409-18036-14evg85/opencv-3.4.1/modules/core/src/hal_internal.cpp:507:202: **error**: 'cBeta' was not declared in this scope
         cblas_zgemm(CblasRowMajor, transA, transB, a_m, d_n, a_n, (double*)reinterpret_cast<fptype(&)[2]>(cAlpha), (double*)src1, ldsrc1, (double*)src2, ldsrc2, (double*)reinterpret_cast<fptype(&)[2]>(cBeta), (double*)dst, lddst);
                                                                                                                                                                                                          ^
[ 38%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/kmeans.cpp.o
```