ilya-biryukov added a comment.

@aaron.ballman , here's a test-case I came up with. I'll fix the other issue 
(invalid error, that forces the test to fail) and submit it for review along 
with the fix for the error. Does that SG?

  template <class T>
  auto make_func() {
    struct impl {
      impl* func() {
        // body of this function is skipped during completion.
        // but will be instantiated anyway.
        return this;
      }
    };
  
    return impl();
  }
  
  void foo() {
    []() {
      make_func<int>();    // currently also produces invalid error `function 
with auto-deduced type 'make_func<int>' is used before defined
      m
      // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:17:6 %s -o - | 
FileCheck %s
      // CHECK: make_func : [#auto#]make_func<<#class T#>>()
  
    };
  }



================
Comment at: lib/Sema/SemaTemplateInstantiateDecl.cpp:3967
       // context seems wrong. Investigate more.
-      ActOnFinishFunctionBody(Function, Body.get(),
-                              /*IsInstantiation=*/true);
+      ActOnFinishFunctionBody(Function, Body.get(), /*IsInstantiation=*/true);
     }
----------------
aaron.ballman wrote:
> This change looks unrelated to the patch.
It was a formatting change.


Repository:
  rC Clang

https://reviews.llvm.org/D44439



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

Reply via email to