brintos

brintos / llvm-project-archived public Read only

0
0
Text · 764 B · 5be8c8c Raw
27 lines · cpp
1// RUN: %clang_cc1 -fsyntax-only -verify -std=c++03 -Wno-c++11-extensions %s2// RUN: %clang_cc1 -fsyntax-only -verify %s3// Don't crash.4 5struct g {6  j; // expected-error {{a type specifier is required for all declarations}}7};8 9void captures_invalid_type() {10  g child;11  auto q = [child]{};12  const int n = sizeof(q);13}14 15void captures_invalid_array_type() {16  g child[100];17  auto q = [child]{};18  const int n = sizeof(q);19}20 21int pr43080(int i) { // expected-note {{declared here}}22  return [] {        // expected-note {{begins here}} expected-note 2 {{capture 'i' by}} expected-note 2 {{default capture by}}23    return sizeof i <24      i; // expected-error {{variable 'i' cannot be implicitly captured in a lambda with no capture-default specified}}25  }();26}27