Debian Codegraph @

clang/test/SemaCXX/conversion-incomplete-type.cpp

raw
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2
3 struct string {};
4
5 class StringPiece; // expected-note {{forward declaration of 'StringPiece'}} \
6 // expected-note {{forward declaration of 'StringPiece'}}
7
8 struct Test {
9 void expectStringPiece(const StringPiece& blah) {}; // expected-note {{passing argument to parameter 'blah' here}}
10
11 void test(const string& s) {
12 expectStringPiece(s); // expected-error {{no viable conversion from 'const string' to incomplete type 'const StringPiece'}}
13 }
14 };
15
16 struct TestStatic {
17 static void expectStringPiece(const StringPiece& blah) {}; // expected-note {{passing argument to parameter 'blah' here}}
18
19 static void test(const string& s) {
20 expectStringPiece(s); // expected-error {{no viable conversion from 'const string' to incomplete type 'const StringPiece'}}
21 }
22 };
23