https://bugs.llvm.org/show_bug.cgi?id=39513

            Bug ID: 39513
           Summary: DR 458 not implemented?
           Product: clang
           Version: 7.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangb...@nondot.org
          Reporter: zi...@kayari.org
                CC: dgre...@apple.com, llvm-bugs@lists.llvm.org,
                    richard-l...@metafoo.co.uk

DR 458 https://wg21.link/cwg458 modified [temp.local] to clarify that names
from the enclosing class do not hide the template parameters of a member
template. Clang does not seem to follow that rule.

This is a modified version of the example in [temp.local] p7 (removing the
parameter of g for reasons):

template<class T> struct A {
  struct B { /* ... */ };
  typedef void C;
  void f();
  template<class U> void g();
};

template<class B> void A<B>::f() {
  B b; // A's B, not the template parameter
}

template<class B> template<class C> void A<B>::g() {
  B b; // A's B, not the template parameter
  C c; // the template parameter C, not A's C
}


I get:

dr458.cc:14:5: error: variable has incomplete type 'A::C' (aka 'void')
  C c; // the template parameter C, not A's C
    ^
1 error generated.


Using:
clang version 7.0.0 (https://git.llvm.org/git/clang.git
1a4f56e161a5ab24aa022f7e8a754e71fa5347a1) (https://git.llvm.org/git/llvm.git
afb8c1fed21eb4848d86f2d28e9cb3afcfbb2656)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to