File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed
Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -296,6 +296,11 @@ StmtResult Parser::ParseStatementOrDeclarationAfterAttributes(
296296 goto Retry;
297297 }
298298
299+ case tok::kw_alignas: {
300+ ParseAlignmentSpecifier (CXX11Attrs);
301+ goto Retry;
302+ }
303+
299304 case tok::kw_template: {
300305 SourceLocation DeclEnd;
301306 ParseTemplateDeclarationOrSpecialization (DeclaratorContext::Block, DeclEnd,
Original file line number Diff line number Diff line change 1+ // Verify that we can parse a simple CUDA file with different attributes order.
2+ // RUN: %clang_cc1 "-triple" "nvptx-nvidia-cuda" -fsyntax-only -verify %s
3+ // expected-no-diagnostics
4+ #include " Inputs/cuda.h"
5+
6+ struct alignas (16 ) float4 {
7+ float x, y, z, w;
8+ };
9+
10+ __attribute__ ((device)) float func() {
11+ __shared__ alignas (alignof (float4 )) float As[4 ][4 ]; // Both combinations
12+ alignas (alignof (float4 )) __shared__ float Bs[4 ][4 ]; // must be legal
13+
14+ return As[0 ][0 ] + Bs[0 ][0 ];
15+ }
You can’t perform that action at this time.
0 commit comments