Skip to content

Methods inherited in nested class generate spurious override error #32659

@llvmbot

Description

@llvmbot
Bugzilla Link 33312
Version 4.0
OS All
Attachments Minimal example demonstrating the problem
Reporter LLVM Bugzilla Contributor
CC @DougGregor

Extended Description

The attached code fails to compile (with clang++ -std=c++11) with the following error:

<source>:14:18: error: 'method' marked 'override' but does not override any member functions
    virtual void method () override {}
                 ^

This fails with every version of clang from 3.1 onwards, but works with all (C++11 supporting) versions of gcc; see https://godbolt.org/g/eI7da0 . Clang-3.0 works ok.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillac++11clang:frontendLanguage frontend issues, e.g. anything involving "Sema"

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions