diff options
author | Hans Wennborg <hans@hanshq.net> | 2017-08-08 18:38:07 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2017-08-08 18:38:07 +0000 |
commit | 8bca255b155a42f114e73d904babc1c3e441f41b (patch) | |
tree | 8dcc4080bacea3648e552790f2fbf7e0cec573bb /test | |
parent | 09efbb85a6403e480ebf70445d0d6ce1815ed24e (diff) |
Merging r308722:
------------------------------------------------------------------------
r308722 | ibiryukov | 2017-07-21 02:24:00 -0700 (Fri, 21 Jul 2017) | 13 lines
Fixed failing assert in code completion.
Summary:
The code was accessing uninstantiated default argument.
This resulted in failing assertion at ParmVarDecl::getDefaultArg().
Reviewers: erikjv, klimek, bkramer, krasimir
Reviewed By: krasimir
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D35682
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_50@310395 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/CodeCompletion/uninstantiated_params.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/CodeCompletion/uninstantiated_params.cpp b/test/CodeCompletion/uninstantiated_params.cpp new file mode 100644 index 0000000000..57a520dd57 --- /dev/null +++ b/test/CodeCompletion/uninstantiated_params.cpp @@ -0,0 +1,13 @@ +template <class T> +struct unique_ptr { + typedef T* pointer; + + void reset(pointer ptr = pointer()); +}; + +void test() { + unique_ptr<int> x; + x. + // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:10:5 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s + // CHECK-CC1: [#void#]reset({#<#unique_ptr<int>::pointer ptr = pointer()#>#}) +} |