aboutsummaryrefslogtreecommitdiff
path: root/test/Sema/function.c
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-02-24 01:23:02 +0000
committerDouglas Gregor <dgregor@apple.com>2009-02-24 01:23:02 +0000
commit04495c859f81e440748a9b86baa2913461652bb0 (patch)
treec13d0124fe2a867d14b29d08537baf7c01350424 /test/Sema/function.c
parent25cbd9ffd59ce575761295f094031daf1afda881 (diff)
Improve merging of function declarations. Specifically:
- When we are declaring a function in local scope, we can merge with a visible declaration from an outer scope if that declaration refers to an entity with linkage. This behavior now works in C++ and properly ignores entities without linkage. - Diagnose the use of "static" on a function declaration in local scope. - Diagnose the declaration of a static function after a non-static declaration of the same function. - Propagate the storage specifier to a function declaration from a prior declaration (PR3425) - Don't name-mangle "main" git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65360 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema/function.c')
-rw-r--r--test/Sema/function.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/Sema/function.c b/test/Sema/function.c
index ff78e719bb..a1d7137796 100644
--- a/test/Sema/function.c
+++ b/test/Sema/function.c
@@ -53,3 +53,8 @@ void f0_3137() {
void f1_3137() {
int (*fp)(void) = g0_3137;
}
+
+void f1static() {
+ static void f2static(int); // expected-error{{function declared in block scope cannot have 'static' storage class}}
+ register void f2register(int); // expected-error{{illegal storage class on function}}
+}