[PATCH] D53847: [C++2a] P0634r3: Down with typename!

Nicolas Lesser via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 21 01:36:55 PDT 2019


Rakete1111 marked an inline comment as done.
Rakete1111 added inline comments.


================
Comment at: clang/lib/Parse/ParseDecl.cpp:4859
     // recurse to handle whatever we get.
-    if (TryAnnotateTypeOrScopeToken())
+    if (TryAnnotateTypeOrScopeToken(!getCurScope()->isTemplateParamScope()))
       return true;
----------------
rsmith wrote:
> This seems surprising to me; I'd expect to have an implicit `typename` here approximately when not `DisambiguatingWithExpression`. Also basing this off the scope seems wrong, as we can switch into and out of implicit `typename` contexts multiple times within a scope. Eg, in `template<typename T, T::template U<T::V>>` we get an implicit `typename` for `T::template U` but not for `T::V` despite them being in the same scope.
> 
> Should the callers of this function be passing in an "implicit `typename`" flag?
Seems like `template <typename T, T::template U<T::V>>` isn't accepted as a context with an implicit typename (for the `T::template`). I'll look into it :)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D53847





More information about the cfe-commits mailing list