[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang / test / SemaCXX / conversion-incomplete-type.cpp
blobebedd04047b950ad2edbb16370c229bb68d78241
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
3 struct string {};
5 class StringPiece; // expected-note {{forward declaration of 'StringPiece'}} \
6 // expected-note {{forward declaration of 'StringPiece'}}
8 struct Test {
9 void expectStringPiece(const StringPiece& blah) {}; // expected-note {{passing argument to parameter 'blah' here}}
11 void test(const string& s) {
12 expectStringPiece(s); // expected-error {{no viable conversion from 'const string' to incomplete type 'const StringPiece'}}
16 struct TestStatic {
17 static void expectStringPiece(const StringPiece& blah) {}; // expected-note {{passing argument to parameter 'blah' here}}
19 static void test(const string& s) {
20 expectStringPiece(s); // expected-error {{no viable conversion from 'const string' to incomplete type 'const StringPiece'}}