Closed llvmbot closed 1 year ago
I think the issue here is essentially that FilterAcceptableTemplateNames tosses out non-template names before Sema::isTemplateName checks for ambiguities. This tricks the parser into treating the identifier as a template-id, and in the end we ignore any non-template results entirely..
Fixed as of Clang 3.0. https://godbolt.org/z/7En361Ezv
Extended Description
The following is accepted by clang++, but rejected by g++ and icpc as an ambiguous reference as both 'int a' and 'template a' are in the global namespace.
namespace A { template struct a { };
}
using namespace A; int a;
/ a should be an ambiguous reference /
a b;
clang++ -v clang version 2.0 (trunk 103456) Target: x86_64-apple-darwin10 Thread model: posix