mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-17 03:26:48 +00:00

This matches how GCC handles it, see e.g. https://gcc.godbolt.org/z/HPplnl. GCC documents the gnu_inline attribute with "In C++, this attribute does not depend on extern in any way, but it still requires the inline keyword to enable its special behavior." The previous behaviour of gnu_inline in C++, without the extern keyword, can be traced back to the original commit that added support for gnu_inline, SVN r69045. Differential Revision: https://reviews.llvm.org/D67414 llvm-svn: 373078
10 lines
304 B
C++
10 lines
304 B
C++
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
|
|
|
extern inline
|
|
__attribute__((__gnu_inline__))
|
|
void gnu_inline1() {}
|
|
|
|
inline
|
|
__attribute__((__gnu_inline__)) // expected-warning {{'gnu_inline' attribute without 'extern' in C++ treated as externally available, this changed in Clang 10}}
|
|
void gnu_inline2() {}
|