brintos

brintos / llvm-project-archived public Read only

0
0
Text · 985 B · 608e9af Raw
23 lines · c
1// RUN: %clang_cc1 -fsyntax-only -verify -frecovery-ast -fno-recovery-ast-type %s2 3int call(int); // expected-note3 {{'call' declared here}}4 5void test1(int s) {6  // verify "assigning to 'int' from incompatible type '<dependent type>'" is7  // not emitted.8  s = call(); // expected-error {{too few arguments to function call}}9 10  // verify diagnostic "operand of type '<dependent type>' where arithmetic or11  // pointer type is required" is not emitted.12  (float)call(); // expected-error {{too few arguments to function call}}13  // verify disgnostic "called object type '<dependent type>' is not a function14  // or function pointer" is not emitted.15  (*__builtin_classify_type)(1); // expected-error {{builtin functions must be directly called}}16}17 18void test2(int* ptr, float f) {19  // verify diagnostic "used type '<dependent type>' where arithmetic or pointer20  // type is required" is not emitted.21  (call() ? ptr : f); // expected-error {{too few arguments to function call}}22}23