]> granicus.if.org Git - clang/commit
[modules] Apply ODR merging for function scoped tags only in C++ mode.
authorVassil Vassilev <v.g.vassilev@gmail.com>
Thu, 8 Sep 2016 20:34:41 +0000 (20:34 +0000)
committerVassil Vassilev <v.g.vassilev@gmail.com>
Thu, 8 Sep 2016 20:34:41 +0000 (20:34 +0000)
commite80eb12ec18bcb15f5df99e4a0742f774538bfb8
tree316ad088106050f5e1e7eb896aa412a39cab1a2b
parent7ccc62bed76c724be090eba5985d6aab8418be67
[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
lib/Sema/SemaLookup.cpp
test/Modules/Inputs/merge-fn-prototype-tags/a.h [new file with mode: 0644]
test/Modules/Inputs/merge-fn-prototype-tags/b.h [new file with mode: 0644]
test/Modules/Inputs/merge-fn-prototype-tags/c.h [new file with mode: 0644]
test/Modules/Inputs/merge-fn-prototype-tags/module.modulemap [new file with mode: 0644]
test/Modules/merge-fn-prototype-tags.c [new file with mode: 0644]