- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
using Intel oneAPI 2021.3.0 the following code does not compile:
################################################
#include <array>
class Base {
public:
enum Types { Al, Mg };
static constexpr unsigned int P = 2;
static constexpr unsigned int bin_Al = 1;
static constexpr unsigned int bin_Mg = 300;
static constexpr std::array<unsigned int, P> bins{bin_Al, bin_Mg};
Base();
};
template <typename Base::Types pNo>
class Derived : public Base {
public:
Derived();
public:
static std::array<double, bins[pNo]> particle_radii;
};
template <typename Base::Types pNo>
std::array<double, Base::bins[pNo]> Derived<pNo>::particle_radii;
################################################
With Intel oneAPI 2021.2.0 it works on LINUX RHEL7 devtoolset-9 and WINDOWS 10 VS 2019 16.10.
Anyone knows what is wrong?
Best regards
Frank
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
#output 2021.2.0
icl -c -Qstd=c++17 a.cxx
Intel(R) C++ Intel(R) 64 Compiler Classic for applications running on Intel(R) 64, Version 2021.3.0 Build 20210609_000000
Copyright (C) 1985-2021 Intel Corporation. All rights reserved.
a.cxx
#output 2021.3.0
icl -c -Qstd=c++17 a.cxx
Intel(R) C++ Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 19.1.1.216 Build 20200306
Copyright (C) 1985-2020 Intel Corporation. All rights reserved.
a.cxx
a.cxx(23): error: declaration is incompatible with "std::array<double, <expression>> Derived<pNo>::particle_radii" (declared at line 19)
std::array<double, Base::bins[pNo]> Derived<pNo>::particle_radii;
^
compilation aborted for a.cxx (code 2)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
sorry previous post was wrong, here is the correct one:
#output 2021.3.0
icl -c -Qstd=c++17 a.cxx
Intel(R) C++ Intel(R) 64 Compiler Classic for applications running on Intel(R) 64, Version 2021.3.0 Build 20210609_000000
Copyright (C) 1985-2021 Intel Corporation. All rights reserved.
a.cxx
a.cxx(23): error: declaration is incompatible with "std::array<double, <expression>> Derived<pNo>::particle_radii" (declared at line 19)
std::array<double, Base::bins[pNo]> Derived<pNo>::particle_radii;
^
compilation aborted for a.cxx (code 2)
#output compxe 2020.1 (oneAPI 2021.2.0 also does this)
icl -c -Qstd=c++17 a.cxx
Intel(R) C++ Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 19.1.1.216 Build 20200306
Copyright (C) 1985-2020 Intel Corporation. All rights reserved.
a.cxx
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Thanks for reaching out to us.
We are able to reproduce the error on a Linux machine having intel oneAPI 2021.3 installed. However we will get back to u soon regarding the error on windows machine.
Thanks,
Santosh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
With
static double particle_radii[bins[pNo]];
and
template <typename Base::Types pNo>
double Derived<pNo>::particle_radii[Base::bins[pNo]];
it works!
The compile output you can see above.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
We are working on your issue internally and we will get back to you soon.
Thanks & Regards,
Santosh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Not sure if you are aware of, but Intel Classic Compiler will enter "Legacy Product Support" mode, signaling the end of regular updates. For that reason, we won't fix this issue in icl. Please migrate your code to icx.
I am going to close this thread as "wont fix".
Sorry for the inconvenience.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page