aboutsummaryrefslogtreecommitdiff
path: root/clang/test/CodeCompletion/constexpr.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-11-19 21:13:18 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-11-19 21:13:18 +0000
commit1ab34b3ad579f43f915cc3ae5c5e2d80fdd7191b (patch)
treec1956d7988e019085776c1ab305e3ea9f8a17721 /clang/test/CodeCompletion/constexpr.cpp
parentf65a638d942b87413a7181acb965e4c2fc4c0c6f (diff)
downloadllvm-1ab34b3ad579f43f915cc3ae5c5e2d80fdd7191b.zip
llvm-1ab34b3ad579f43f915cc3ae5c5e2d80fdd7191b.tar.gz
llvm-1ab34b3ad579f43f915cc3ae5c5e2d80fdd7191b.tar.bz2
PR14381: Never skip constexpr function bodies when code-completing. We may need
them in order to parse the rest of the file. llvm-svn: 168327
Diffstat (limited to 'clang/test/CodeCompletion/constexpr.cpp')
-rw-r--r--clang/test/CodeCompletion/constexpr.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/test/CodeCompletion/constexpr.cpp b/clang/test/CodeCompletion/constexpr.cpp
new file mode 100644
index 0000000..12396c0
--- /dev/null
+++ b/clang/test/CodeCompletion/constexpr.cpp
@@ -0,0 +1,13 @@
+// RUN: %clang_cc1 -fsyntax-only -std=c++11 -code-completion-at=%s:12:9 %s -o - | FileCheck %s
+
+// PR14381: need constexpr function bodies always, even if code-completing.
+template<int> struct S;
+template<> struct S<1> {
+ typedef int type;
+};
+constexpr int f() {
+ return 1;
+}
+
+S<f()>::
+// CHECK: COMPLETION: type : type