diff options
Diffstat (limited to 'clang/test/SemaCXX/decl-init-ref.cpp')
| -rw-r--r-- | clang/test/SemaCXX/decl-init-ref.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/decl-init-ref.cpp b/clang/test/SemaCXX/decl-init-ref.cpp index 42b9286852c..fb5ca8c1491 100644 --- a/clang/test/SemaCXX/decl-init-ref.cpp +++ b/clang/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}} + } +} |

