diff options
Diffstat (limited to 'clang/test/Sema/inline.c')
-rw-r--r-- | clang/test/Sema/inline.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/clang/test/Sema/inline.c b/clang/test/Sema/inline.c index 6c95a7a14b4..c27c00efaad 100644 --- a/clang/test/Sema/inline.c +++ b/clang/test/Sema/inline.c @@ -26,6 +26,20 @@ static inline int useStaticFromStatic () { return staticVar; // no-warning } +extern inline int useStaticInlineFromExtern () { + // Heuristic: if the function we're using is also inline, don't warn. + // This can still be wrong (in this case, we end up inlining calls to + // staticFunction and staticVar) but this got very noisy even using + // standard headers. + return useStaticFromStatic(); // no-warning +} + +static int constFunction() __attribute__((const)); + +inline int useConst () { + return constFunction(); // no-warning +} + #else // ------- // This is the main source file. |