]> granicus.if.org Git - clang/commit
[GCC] Support for __final specifier
authorAndrey Bokhanko <andreybokhanko@gmail.com>
Fri, 29 Jul 2016 10:42:48 +0000 (10:42 +0000)
committerAndrey Bokhanko <andreybokhanko@gmail.com>
Fri, 29 Jul 2016 10:42:48 +0000 (10:42 +0000)
commitedaa4311e54be8a88ba9881ad9689ed9d0f60da2
treee0ff738e9ef5f409d44e0f2c99c44e7badc1d9fb
parent3ebf3b24cf37c2870f671eea0041dcff73994804
[GCC] Support for __final specifier

As reported in bug 28473, GCC supports "final" functionality in pre-C++11 code using the __final keyword. Clang currently supports the "final" keyword in accordance with the C++11 specification, however it ALSO supports it in pre-C++11 mode, with a warning.

This patch adds the "__final" keyword for compatibility with GCC in GCC Keywords mode (so it is enabled with existing flags), and issues a warning on its usage (suggesting switching to the C++11 keyword). This patch also adds a regression test for the functionality described. I believe this patch has minimal impact, as it simply adds a new keyword for existing behavior.

This has been validated with check-clang to avoid regressions. Patch is created in reference to revisions 276665.

Patch by Erich Keane.

Differential Revision: https://reviews.llvm.org/D22919

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@277134 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/DiagnosticSemaKinds.td
include/clang/Parse/Parser.h
include/clang/Sema/DeclSpec.h
lib/Parse/ParseDeclCXX.cpp
lib/Sema/DeclSpec.cpp
test/Parser/gcc-__final-compatibility.cpp [new file with mode: 0644]