aaron.ballman added inline comments.

================
Comment at: clang/lib/Parse/ParseDecl.cpp:6485-6488
+    if (getLangOpts().CPlusPlus && !D.getIdentifier() &&
+        D.getName().getKind() == UnqualifiedIdKind::IK_TemplateId &&
+        D.getContext() == DeclaratorContext::Member)
+      D.SetIdentifier(D.getName().TemplateId->Name, D.getName().getBeginLoc());
----------------
This fix looks incredibly specific to the bug report, how does it handle other 
situations, like:
```
template <typename T, template <typename> typename U>
class PR28101 {
public:
  PR28101(void *) {}
  T(PR28101<T, U<T>>) {} // Do we err here?
};

template <typename T>
struct S {};

PR28101<int, S> foo() { return PR28101<int, S>(nullptr); }
```


================
Comment at: clang/test/CXX/temp/temp.decls/temp.mem/p3.cpp:12-13
+  PR28101(void *) {}
+  T(PR28101<T>){}; // expected-error{{member 'PR28101' has the same name as 
its class}} \
+  // expected-error{{member 'PR28101' has the same name as its class}}
+};
----------------
It seems incorrect that we're issuing the same diagnostic twice. Is this 
because of template instantiation, or some other reason?


================
Comment at: clang/test/CXX/temp/temp.decls/temp.mem/p3.cpp:16
+
+PR28101<int> foo() { return new int; } // expected-note{{in instantiation of 
template class 'PR28101<int>' requested here}}
----------------
The test location is a bit novel -- [temp.mem]p3 is "A member function template 
shall not be declared virtual." and I don't see anything related to p3 in this 
test. I think the test case is reasonable enough, but it should probably live 
in SemaCXX instead of here.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115248/new/

https://reviews.llvm.org/D115248

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to