Intel® C++ Compiler
Support and discussions for creating C++ code that runs on platforms based on Intel® processors.
Announcements
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.
7683 Discussions

Bug: Intel C++ expects "override" keyword in incorrect grammar position

Mears__Melissa
Beginner
146 Views

Copied from the GCC bug I reported, because it applies to Intel C++ as well.  At least, the version "18" on https://gcc.godbolt.org/.

Intel C++ expects the "override" keyword in an incorrect position in the C++ grammar:

#define MEOW 256
struct Base {
    virtual const char (&GetBuffer() const)[MEOW] = 0;
};
struct Derived : public Base {
    // Intel C++ requires this incorrect syntax...
    virtual const char (&GetBuffer() const override)[MEOW];
    // ...but the below is the correct syntax, which Intel C++ rejects.
    virtual const char (&GetBuffer() const)[MEOW] override;
};

In the C++ Standard, "override" is a virt-specifier in a virt-specifier-seq. virt-specifier-seq optionally goes after the declarator. After the optional virt-specifier-seq goes the optional pure-specifier.

0 Kudos
1 Reply
Viet_H_Intel
Moderator
146 Views

Hi,

Thank for reporting this issue. I'll submit a bug to our developer.

Regards,

Viet

Reply