| 1 |
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -std=hlsl202x -o - -fsyntax-only %s -verify |
| 2 |
|
| 3 |
// template not allowed inside cbuffer. |
| 4 |
cbuffer A { |
| 5 |
// expected-error@+2 {{invalid declaration inside cbuffer}} |
| 6 |
template<typename T> |
| 7 |
T foo(T t) { return t;} |
| 8 |
} |
| 9 |
|
| 10 |
cbuffer A { |
| 11 |
// expected-error@+2 {{invalid declaration inside cbuffer}} |
| 12 |
template<typename T> |
| 13 |
struct S { float s;}; |
| 14 |
} |
| 15 |
|
| 16 |
// typealias not allowed inside cbuffer. |
| 17 |
cbuffer A { |
| 18 |
// expected-error@+1 {{invalid declaration inside cbuffer}} |
| 19 |
using F32 = float; |
| 20 |
} |