This is an archive of the discontinued LLVM Phabricator instance.

[AST][RecoveryExpr] Add error-bit to NestNameSpecifierDependence and TemplateNameDependence.
ClosedPublic

Authored by hokein on Jun 25 2020, 1:36 AM.

Details

Summary

We might lose the error-bit if the error-bit goes through the code path
"error type/expr" -> "error template argument" -> "nested name specifier" ->
... -> "template Specialization type"

Template name also needs this, as a template can be nested into
an error specifier, e.g. templateName apply in
TC<decltype(<recovery-expr>(Foo, int()))>::template apply

Diff Detail

Event Timeline

hokein created this revision.Jun 25 2020, 1:36 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 25 2020, 1:36 AM

friendly ping, we start encountering this crash in production.

another reduced testcase:

using a = decltype(b())::a;
  template < class c > class d {
    using UnderlyingBuilder = c::UnderlyingBuilder:template < class > class e  
    class f  {
    using g = UnderlyingBuildertype;
    }class StorageNoDestruct
        : c::k<
              e< f:g > > {}  
  using h = StorageNoDestructtype;
    static_assert(alignof(h) == alignof(f),
                  ""}template < class > class i {
  using UnderlyingBuilder =
        a;
    template < class > class k  
  }class j 
      : d< i< j  > >
sammccall accepted this revision.Jun 30 2020, 1:25 AM
sammccall added inline comments.
clang/include/clang/AST/DependenceFlags.h
67

FWIW I don't think this macro is worth the complexity, maybe we should expand it out at some point.

This revision is now accepted and ready to land.Jun 30 2020, 1:25 AM
This revision was automatically updated to reflect the committed changes.