diff options
| author | Ilya Biryukov <ibiryukov@google.com> | 2017-07-21 09:24:00 +0000 |
|---|---|---|
| committer | Ilya Biryukov <ibiryukov@google.com> | 2017-07-21 09:24:00 +0000 |
| commit | b6d1ec80736788015dbb12b48d9cf6bc4c534fda (patch) | |
| tree | 882ec98797ca7dd20288f816d0ca549211e564d3 /clang/test/CodeCompletion | |
| parent | ba3bd7ce3e4976983a2d04f84bb6b8ea1ed32a85 (diff) | |
| download | bcm5719-llvm-b6d1ec80736788015dbb12b48d9cf6bc4c534fda.tar.gz bcm5719-llvm-b6d1ec80736788015dbb12b48d9cf6bc4c534fda.zip | |
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
llvm-svn: 308722
Diffstat (limited to 'clang/test/CodeCompletion')
| -rw-r--r-- | clang/test/CodeCompletion/uninstantiated_params.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/test/CodeCompletion/uninstantiated_params.cpp b/clang/test/CodeCompletion/uninstantiated_params.cpp new file mode 100644 index 00000000000..57a520dd571 --- /dev/null +++ b/clang/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()#>#}) +} |

