File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -4024,12 +4024,17 @@ bool FunctionDecl::isInlineDefinitionExternallyVisible() const {
4024
4024
ASTContext &Context = getASTContext ();
4025
4025
4026
4026
if (Context.getLangOpts ().GNUInline || hasAttr<GNUInlineAttr>()) {
4027
+ // GNU inline semantics:
4028
+ //
4029
+ // A function defined 'inline' is externally visible.
4030
+ // A function defined 'extern inline' is not externally visible.
4031
+ //
4032
+ // If any declaration is 'inline' but not 'extern', the definition is
4033
+ // externally visible. This is the only case that matters for a function
4034
+ // defined 'extern inline'.
4035
+ //
4027
4036
// Note: If you change the logic here, please change
4028
4037
// doesDeclarationForceExternallyVisibleDefinition as well.
4029
- //
4030
- // If it's not the case that both 'inline' and 'extern' are
4031
- // specified on the definition, then this inline definition is
4032
- // externally visible.
4033
4038
if (Context.getLangOpts ().CPlusPlus )
4034
4039
return false ;
4035
4040
if (!(isInlineSpecified () && getStorageClass () == SC_Extern))
You can’t perform that action at this time.
0 commit comments