llvm-project/clang/test/CXX/temp
Serge Pavlov e50bf75196 Fix recognition of shadowed template parameter
Crash reported in PR28023 is caused by the fact that non-type template
parameters are found by tag name lookup.  In the code provided in that PR:

template<int V> struct A {
  struct B {
    template <int> friend struct V;
  };
};

the template parameter V is found when lookup for redeclarations of 'struct V'
is made. Latter on the error about shadowing of 'V' is emitted but the semantic
context of 'struct V' is already determined wrong: 'struct A' instead of
translation unit.

The fix moves the check for shadowing toward the beginning of the method and
thus prevents from wrong context calculations.

This change fixes PR28023.

llvm-svn: 272366
2016-06-10 04:39:07 +00:00
..
temp.arg [Parser] Clear the TemplateParamScope bit of the current scope's flag 2016-04-29 02:24:14 +00:00
temp.decls Warn if function or variable cannot be implicitly instantiated 2016-04-19 06:19:52 +00:00
temp.fct.spec When deducing template parameters from base classes of an argument type, don't 2016-04-25 19:09:05 +00:00
temp.names Prior to adding the new "expected-no-diagnostics" directive to VerifyDiagnosticConsumer, make the necessary adjustment to 580 test-cases which will henceforth require this new directive. 2012-10-19 12:44:48 +00:00
temp.param [Lit Test] Updated 34 Lit tests to be C++11 compatible. 2015-11-17 20:25:05 +00:00
temp.res Fix recognition of shadowed template parameter 2016-06-10 04:39:07 +00:00
temp.spec Lit C++11 Compatibility Patch #8 2016-04-14 23:47:07 +00:00
temp.type
p3.cpp Implement DR482: namespace members can be redeclared with a qualified name 2013-12-05 07:51:02 +00:00