================
@@ -31,17 +31,11 @@ static bool 
validateDeclsInsideHLSLBuffer(Parser::DeclGroupPtrTy DG,
   // Only allow function, variable, record, and empty decls inside HLSLBuffer.
   for (DeclGroupRef::iterator I = Decls.begin(), E = Decls.end(); I != E; ++I) 
{
     Decl *D = *I;
-    if (isa<CXXRecordDecl, RecordDecl, FunctionDecl, VarDecl, EmptyDecl>(D))
+    if (isa<CXXRecordDecl, RecordDecl, FunctionDecl, VarDecl, EmptyDecl,
+            EnumDecl, UsingDecl, UsingDirectiveDecl, TypeAliasDecl,
+            TemplateDecl, TypedefDecl, ExportDecl, StaticAssertDecl>(D))
----------------
Icohedron wrote:

[TC57 0005](https://hlsl-tc57.github.io/tc57/proposal/0005/) says a cbuffer may 
not contain a namespace declaration. However, [the grammar for a 
`cbuffer-member-declaration` allows 
`block-declaration`](https://github.com/hlsl-tc57/tc57/blob/5be379afba6ab3623c4140b484ab4fd0fb4eb7a5/spec/declarations.tex#L256-L257),
 which [includes namespace 
aliases](https://github.com/hlsl-tc57/tc57/blob/5be379afba6ab3623c4140b484ab4fd0fb4eb7a5/spec/declarations.tex#L26-L28).

Therefore, is a namespace alias such as `namespace Alias = N;` meant to be 
excluded too?

The spec should probably be revised to clarify this.


https://github.com/llvm/llvm-project/pull/239481
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to