brintos

brintos / llvm-project-archived public Read only

0
0
Text · 876 B · e092ab8 Raw
33 lines · cpp
1// RUN: %clang_cc1 -fsyntax-only -verify -std=c++20 %s2 3namespace GH49093 {4  class B {5  public:6    static int a() { return 0; } // expected-note {{declared as a non-template here}}7    decltype(a< 0 >(0)) test;    // expected-error {{'a' does not refer to a template}}8  };9 10  struct C {11      static int a() { return 0; } // expected-note {{declared as a non-template here}}12      decltype(a < 0 > (0)) test;  // expected-error {{'a' does not refer to a template}}13  };14 15  void test_is_bool(bool t) {}16  void test_is_bool(int t) {}17 18  int main() {19    B b;20    test_is_bool(b.test);21 22    C c;23    test_is_bool(c.test);24  }25}26 27namespace GH107047 {28  struct A {29    static constexpr auto test() { return 1; } // expected-note {{declared as a non-template here}}30    static constexpr int s = test< 1 >();      // expected-error {{'test' does not refer to a template}}31  };32}33