brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.2 KiB · 62f5529 Raw
76 lines · cpp
1// RUN: %clang_cc1 -fsyntax-only -std=c++11 -verify %s2// RUN: %clang_cc1 -fsyntax-only -std=c++11 -fallow-editor-placeholders -DSUPPRESS -verify %s3 4struct Struct {5public:6    void method(Struct &x);7};8 9struct <#struct name#> {10  int <#field-name#>;11#ifndef SUPPRESS12  // expected-error@-3 {{editor placeholder in source file}}13  // expected-error@-3 {{editor placeholder in source file}}14#endif15};16 17typename <#typename#>::<#name#>;18decltype(<#expression#>) foobar;19typedef <#type#> <#name#>;20#ifndef SUPPRESS21  // expected-error@-4 2 {{editor placeholder in source file}}22  // expected-error@-4 {{editor placeholder in source file}}23  // expected-error@-4 2 {{editor placeholder in source file}}24#endif25 26namespace <#identifier#> {27  <#declarations#>28#ifndef SUPPRESS29  // expected-error@-3 {{editor placeholder in source file}}30  // expected-error@-3 {{editor placeholder in source file}}31#endif32 33}34 35using <#qualifier#>::<#name#>;36#ifndef SUPPRESS37  // expected-error@-2 2 {{editor placeholder in source file}}38#endif39 40void avoidPlaceholderErrors(Struct &obj) {41    static_cast< <#type#> >(<#expression#>);42    while (<#condition#>) {43        <#statements#>44    }45    obj.method(<#Struct &x#>);46#ifndef SUPPRESS47  // expected-error@-6 2 {{editor placeholder in source file}}48  // expected-error@-6 {{editor placeholder in source file}}49  // expected-error@-6 {{editor placeholder in source file}}50  // expected-error@-5 {{editor placeholder in source file}}51#endif52    switch (<#expression#>) {53        case <#constant#>:54            <#statements#>55#ifndef SUPPRESS56  // expected-error@-4 {{editor placeholder in source file}}57  // expected-error@-4 {{editor placeholder in source file}}58  // expected-error@-4 {{editor placeholder in source file}}59#endif60            break;61 62        default:63            break;64    }65}66 67void Struct::method(<#Struct &x#>, noSupressionHere) { // expected-error {{unknown type name 'noSupressionHere'}}68#ifndef SUPPRESS69  // expected-error@-2 {{editor placeholder in source file}}70#endif71}72 73void handleTrigraph() {74  <??=placeholder#> // expected-error {{expected expression}} expected-error {{expected expression}} expected-warning {{trigraph converted to '#' character}}75}76