Fix a diagnoses-valid bug with using declarationsThe following was found by a customer and is accepted by the other primaryC++ compilers, but fails to compile in Clang:namespace sss {double foo
Fix a diagnoses-valid bug with using declarationsThe following was found by a customer and is accepted by the other primaryC++ compilers, but fails to compile in Clang:namespace sss {double foo(int, double);template <class T>T foo(T); // note: target of using declaration} // namespace sssnamespace oad {void foo();}namespace oad {using ::sss::foo;}namespace sss {using oad::foo; // note: using declaration}namespace sss {double foo(int, double) { return 0; }template <class T>T foo(T t) { // error: declaration conflicts with target of using return t;}} // namespace sssI believe the issue is that MergeFunctionDecl() was callingcheckUsingShadowRedecl() but only considering a FunctionDecl as apossible shadow and not FunctionTemplateDecl. The changes in this patchlargely mirror how variable declarations were being handled by alsocatching FunctionTemplateDecl.
show more ...
[Modules TS] Module ownership semantics for redeclarations.When declaring an entity in the "purview" of a module, it's never aredeclaration of an entity in the purview of a default module or in no
[Modules TS] Module ownership semantics for redeclarations.When declaring an entity in the "purview" of a module, it's never aredeclaration of an entity in the purview of a default module or in no module("in the global module"). Don't consider those other declarations as possibleredeclaration targets if they're not visible, and reject any cases where wepick a prior visible declaration that violates this rule.This reinstates r315251 and r315256, reverted in r315309 and r315308respectively, tweaked to avoid triggering a linkage calculation when declaringimplicit special members (this exposed our pre-existing issue with typedefnames for linkage changing the linkage of types whose linkage has already beencomputed and cached in more cases). A testcase for that regression has beenadded in r315366.llvm-svn: 315379
Revert "[Modules TS] Module ownership semantics for redeclarations."This reverts commit r315251. See the original commit thread for reason.llvm-svn: 315309
[Modules TS] Module ownership semantics for redeclarations.When declaring an entity in the "purview" of a module, it's never aredeclaration of an entity in the purview of a default module or in no module("in the global module"). Don't consider those other declarations as possibleredeclaration targets if they're not visible, and reject any cases where wepick a prior visible declaration that violates this rule.llvm-svn: 315251