Skip to content
Commit 2684c68d authored by Jordan Rose's avatar Jordan Rose
Browse files

Warn when a static variable is referenced in a non-static inline function.

This is explicitly forbidden in C99 6.7.4p3. This is /not/ forbidden in C++,
probably because by default file-scope const/constexpr variables have internal
linkage, while functions have external linkage. There's also the issue of
anonymous namespaces to consider. Nevertheless, there should probably be a
similar warning, since the semantics of inlining a function that references
a variable with internal linkage do not seem well-defined.

<rdar://problem/11577619>

llvm-svn: 158531
parent 7c0abc34
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment