summaryrefslogtreecommitdiffstats
path: root/test/SemaCXX/decl-init-ref.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaCXX/decl-init-ref.cpp')
-rw-r--r--test/SemaCXX/decl-init-ref.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/SemaCXX/decl-init-ref.cpp b/test/SemaCXX/decl-init-ref.cpp
index 42b9286852..fb5ca8c149 100644
--- a/test/SemaCXX/decl-init-ref.cpp
+++ b/test/SemaCXX/decl-init-ref.cpp
@@ -36,3 +36,12 @@ namespace PR16502 {
int f();
const A &c = { 10, ++c.temporary };
}
+
+namespace IncompleteTest {
+ struct String;
+ // expected-error@+1 {{reference to incomplete type 'const IncompleteTest::String' could not bind to an lvalue of type 'const char [1]'}}
+ void takeString(const String& = "") {} // expected-note {{passing argument to parameter here}} expected-note {{candidate function}}
+ void test() {
+ takeString(); // expected-error {{no matching function for call}}
+ }
+}