[all-commits] [llvm/llvm-project] 05ed3e: Handle delayed-template-parsing functions imported...

Sam McCall via All-commits all-commits at lists.llvm.org
Fri Jun 12 07:10:10 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 05ed3efc2ac7b34bd62b1cbac88ff9a47b649cc5
      https://github.com/llvm/llvm-project/commit/05ed3efc2ac7b34bd62b1cbac88ff9a47b649cc5
  Author: Sam McCall <sam.mccall at gmail.com>
  Date:   2020-06-12 (Fri, 12 Jun 2020)

  Changed paths:
    M clang/lib/Parse/Parser.cpp
    A clang/test/PCH/delayed-template-parsing.cpp

  Log Message:
  -----------
  Handle delayed-template-parsing functions imported into a non-dtp TU

Summary:
DelayedTemplateParsing is marked as BENIGN_LANGOPT, so we are allowed to
use a delayed template in a non-delayed TU.
(This is clangd's default configuration on windows: delayed-template-parsing
is on for the preamble and forced off for the current file)

However today clang fails to parse implicit instantiations in a non-dtp
TU of templates defined in a dtp PCH file (and presumably module?).
In this case the delayed parser is not registered, so the function is
simply marked "delayed" again. We then hit an assert:
end of TU template instantiation should not create more late-parsed templates

Reviewers: rsmith

Subscribers: ilya-biryukov, usaxena95, cfe-commits, kadircet

Tags: #clang

Differential Revision: https://reviews.llvm.org/D81474




More information about the All-commits mailing list