brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.0 KiB · 29ab422 Raw
34 lines · cpp
1// RUN: %clang_cc1 -fsyntax-only -verify -std=c++17 %s2 3// Ensure that we don't crash if errors are suppressed by an error limit.4// RUN: not %clang_cc1 -fsyntax-only -std=c++17 -ferror-limit 1 %s5 6template <bool is_const, typename tag_t = void>7struct tv_val {8};9 10template <bool is_const>11auto &val(const tv_val<is_const> &val) { return val.val(); } // expected-note {{possible target for call}}12 13struct Class {14  template <bool is_const>15  struct Entry {16    tv_val<is_const> val;17  };18};19 20enum Types : int {21  Class = 1, // expected-note 2 {{struct 'Class' is hidden}}22};23 24struct Record {25  Class *val_;            // expected-error {{must use 'struct' tag}}26  void setClass(Class *); // expected-error {{must use 'struct' tag}}27};28 29void Record::setClass(Class *val) { // expected-error {{variable has incomplete type 'void'}} \30                                   // expected-error {{reference to overloaded function}} \31                                   // expected-error {{expected ';' after top level declarator}}32  val_ = val;33}34