diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-03-26 04:09:53 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-03-26 04:09:53 +0000 |
commit | 65ebb4ac8a7119a16e5a00b075e5b382fd4e434c (patch) | |
tree | aba5d66b22388b22c9c2f62df8fd03f0ecacfcb1 /clang/test/Modules/submodules-merge-defs.cpp | |
parent | e972c3622113feaeaf4c1a7c8a60d193c385cb06 (diff) | |
download | bcm5719-llvm-65ebb4ac8a7119a16e5a00b075e5b382fd4e434c.tar.gz bcm5719-llvm-65ebb4ac8a7119a16e5a00b075e5b382fd4e434c.zip |
[modules] If we reach a definition of a class for which we already have a
non-visible definition, skip the new definition and make the old one visible
instead of trying to parse it again and failing horribly. C++'s ODR allows
us to assume that the two definitions are identical.
llvm-svn: 233250
Diffstat (limited to 'clang/test/Modules/submodules-merge-defs.cpp')
-rw-r--r-- | clang/test/Modules/submodules-merge-defs.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/test/Modules/submodules-merge-defs.cpp b/clang/test/Modules/submodules-merge-defs.cpp new file mode 100644 index 00000000000..48d4feb7cfe --- /dev/null +++ b/clang/test/Modules/submodules-merge-defs.cpp @@ -0,0 +1,13 @@ +// RUN: rm -rf %t +// RUN: %clang_cc1 -x c++ -fmodules-cache-path=%t -fmodules -I %S/Inputs/submodules-merge-defs %s -verify -fno-modules-error-recovery + +// Trigger import of definitions, but don't make them visible. +#include "empty.h" + +A pre_a; // expected-error {{must be imported}} expected-error {{must use 'struct'}} +// expected-note@defs.h:1 {{here}} + +// Make definitions from second module visible. +#include "import-and-redefine.h" + +A post_a; |