Bug 64794 - GCC failed at virtual function with "override" trailing return type name, followed by override virt-specifier
Summary: GCC failed at virtual function with "override" trailing return type name, fo...
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 5.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2015-01-26 04:50 UTC by Ryou Ezoe
Modified: 2021-12-09 06:42 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2021-12-08 00:00:00


Attachments
compilation failure log (1.05 KB, text/plain)
2020-05-30 18:28 UTC, Atul Sharma
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ryou Ezoe 2015-01-26 04:50:00 UTC
GCC failed at virtual function with "override"
 trailing return type name, followed by override virt-specifier.

Following code should be well-formed.

struct override { } ;

struct Base
{
    virtual auto f() -> override ; 
} ;

struct Derived : Base
{
// GCC issues error: two or more data types in declaration of 'type name'
    auto f() -> override override ;
} ;
Comment 1 Atul Sharma 2020-05-30 18:28:36 UTC
Created attachment 48645 [details]
compilation failure log

This file contains the compilation failure statements
Comment 2 Atul Sharma 2020-05-30 18:31:35 UTC
Is there any update on the issue 
I am facing this issue on the newer version of gcc(10.1.) as well
Added the details of compilation failure as attachement

I have been facing issue for the following mention code with the error 
/*
main.cpp:11:17: error: two or more data types in declaration of 'type name'
   11 |     auto f() -> override override ;
*/

struct override { } ; 
 
struct base
{
    virtual auto f() -> override ; 
} ;
 
struct derived : base
{
    auto f() -> override override ;
} ;                                                                                                                                                  
 
int main()
{
    return 0;
}
------
This should not have caused compilation failure since override specifier is not a keyword and can be used to define a custom type