mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-23 07:52:06 +00:00
edbc6e93e1
1) Merge and demote variable definitions when we find a redefinition in MergeVarDecls, not only when we find one in AddInitializerToDecl (we only reach the second case if it's the addition of the initializer itself that converts an existing declaration into a definition). 2) When rebuilding a redeclaration chain for a variable, if we merge two definitions together, mark the definitions as merged so the retained definition is made visible whenever the demoted definition would have been. Original commit message (from r283882): [modules] PR28752: Do not instantiate variable declarations which are not visible. Original patch by Vassil Vassilev! Changes listed above are mine. llvm-svn: 284284
23 lines
680 B
C++
23 lines
680 B
C++
// RUN: rm -rf %t
|
|
// RUN: %clang_cc1 -std=c++11 -nostdsysteminc -I%S/Inputs/PR28752 -verify %s
|
|
// RUN: %clang_cc1 -std=c++11 -nostdsysteminc -fmodules -fmodule-map-file=%S/Inputs/PR28752/Subdir1/module.modulemap -fmodule-map-file=%S/Inputs/PR28752/module.modulemap -fmodules-cache-path=%t -I%S/Inputs/PR28752 -I%S/Inputs/PR28752/Subdir1 -verify %s -fmodules-local-submodule-visibility
|
|
|
|
#include "a.h"
|
|
#include "Subdir1/c.h"
|
|
#include <vector>
|
|
|
|
class TClingClassInfo {
|
|
std::vector<int> fIterStack;
|
|
};
|
|
|
|
TClingClassInfo *a;
|
|
class TClingBaseClassInfo {
|
|
TClingBaseClassInfo() { new TClingClassInfo(*a); }
|
|
};
|
|
|
|
namespace { struct Q; }
|
|
bool *p = &A<Q>::b;
|
|
|
|
// expected-no-diagnostics
|
|
|