brintos

brintos / llvm-project-archived public Read only

0
0
Text · 839 B · eb0b7e4 Raw
55 lines · cpp
1// RUN: %clang_cc1 -fsyntax-only -verify %s2// expected-no-diagnostics3 4namespace PR6382 {5  int foo()6  {7    goto error;8    {9      struct BitPacker {10        BitPacker() {}11      };12      BitPacker packer;13    }14 15  error:16    return -1;17  }18}19 20namespace PR6383 {21  void test (bool gross)22  {23    struct compare_and_set24    {25      void operator() (const bool inner, const bool gross = false)26      {27        // the code28      }29    } compare_and_set2;30 31    compare_and_set2 (false, gross);32  }33}34 35namespace Templates {36  template<int Value>37  void f() {38    struct Inner {39      static int getValue() { return Value; }40    };41  }42}43 44namespace PR25627_dont_odr_use_local_consts {45  template<int> struct X { X(); X(int); };46  47  void foo() {48    const int N = 10;49  50    struct Local {51      void f(X<N> = X<N>()) {} // OK52    }; 53  }54}55