diff options
author | Vassil Vassilev <v.g.vassilev@gmail.com> | 2016-09-08 20:34:41 +0000 |
---|---|---|
committer | Vassil Vassilev <v.g.vassilev@gmail.com> | 2016-09-08 20:34:41 +0000 |
commit | e80eb12ec18bcb15f5df99e4a0742f774538bfb8 (patch) | |
tree | 316ad088106050f5e1e7eb896aa412a39cab1a2b /test/Modules/merge-fn-prototype-tags.c | |
parent | 7ccc62bed76c724be090eba5985d6aab8418be67 (diff) | |
download | clang-e80eb12ec18bcb15f5df99e4a0742f774538bfb8.tar.gz |
[modules] Apply ODR merging for function scoped tags only in C++ mode.
In C mode, if we have a visible declaration but not a visible definition, a tag
defined in the declaration should be have a visible definition. In C++ we rely
on the ODR merging, whereas in C we cannot because each declaration of a
function gets its own set of declarations in its prototype scope.
Patch developed in collaboration with Richard Smith!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@280984 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Modules/merge-fn-prototype-tags.c')
-rw-r--r-- | test/Modules/merge-fn-prototype-tags.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/Modules/merge-fn-prototype-tags.c b/test/Modules/merge-fn-prototype-tags.c new file mode 100644 index 0000000000..f43f1dc49d --- /dev/null +++ b/test/Modules/merge-fn-prototype-tags.c @@ -0,0 +1,8 @@ +// RUN: rm -rf %t +// RUN: %clang_cc1 -x c -I%S/Inputs/merge-fn-prototype-tags -verify %s +// RUN: %clang_cc1 -fmodules -fmodule-map-file=%S/Inputs/merge-fn-prototype-tags/module.modulemap -fmodules-cache-path=%t -x c -I%S/Inputs/merge-fn-prototype-tags -verify %s + +#include "c.h" +void mmalloc_attach() { struct stat sbuf; } + +// expected-no-diagnostics |