view clang/test/Parser/for.cpp @ 223:5f17cb93ff66 llvm-original

LLVM13 (2021/7/18)
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 18 Jul 2021 22:43:00 +0900
parents 1d019706d866
children
line wrap: on
line source

// RUN: %clang_cc1 -fsyntax-only -verify %s

void f1() {
  int n;

  for (n = 0; n < 10; n++);

  for (n = 0 n < 10; n++); // expected-error {{expected ';' in 'for'}}
  for (n = 0; n < 10 n++); // expected-error {{expected ';' in 'for'}}

  for (int n = 0 n < 10; n++); // expected-error {{expected ';' in 'for'}}
  for (int n = 0; n < 10 n++); // expected-error {{expected ';' in 'for'}}

  for (n = 0 bool b = n < 10; n++); // expected-error {{expected ';' in 'for'}}
  for (n = 0; bool b = n < 10 n++); // expected-error {{expected ';' in 'for'}}

  for (n = 0 n < 10 n++); // expected-error 2{{expected ';' in 'for'}}

  for (;); // expected-error {{expected ';' in 'for'}}
}