[Bug c++/68313] "using" shadows declaration
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68313 Andrew Pinski changed: What|Removed |Added Keywords||rejects-valid Known to fail||5.1.0, 5.5.0 Status|UNCONFIRMED |RESOLVED Known to work||6.1.0, 7.1.0 Target Milestone|--- |6.0 Resolution|--- |FIXED --- Comment #3 from Andrew Pinski --- Fixed in GCC 6+.
[Bug c++/68313] "using" shadows declaration
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68313 Johannes Schaub changed: What|Removed |Added CC||schaub.johannes@googlemail. ||com --- Comment #1 from Johannes Schaub --- If instead of namespaces you would have used a class, and class N1 would be a baseclass of N2, your code would be ill-formed to the letter of the Standard: "A non-template member function ([dcl.fct]) with a given name and type and a member function template of the same name, which could be used to generate a specialization of the same type, can both be declared in a class. When both exist, a use of that name and type refers to the non-template member unless an explicit template argument list is supplied." What happens if you use unqualified names, i.e. if you declare the explicit instantiation directly in namespace N2. And what happens if you use a "<>" to try and explicitly refer to the template? Just as a question of interest.
[Bug c++/68313] "using" shadows declaration
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68313 wd11 at leicester dot ac.uk changed: What|Removed |Added Version|unknown |5.1.0 --- Comment #2 from wd11 at leicester dot ac.uk --- Johannes, regarding the case with nested classes (in analogy to the second code snippet), void f() and void f(X) don't have the same type (signature, or what is referred to with 'type of a function' here), so the program would still be okay. > What happens if you use unqualified names, i.e. if you declare the explicit > instantiation directly in namespace N2? I presume you refer to the first code snippet: same error > And what happens if you use a "<>" to try and explicitly refer to the > template? no error in either code snippet.