hans added a comment.
I think this is reasonable. Just a few comments:
================
Comment at: lib/Sema/SemaDecl.cpp:11796
@@ +11795,3 @@
+ if (auto *DS = dyn_cast<DeclStmt>(S)) {
+ if (DS->isSingleDecl()) {
+ if (auto *Var = dyn_cast_or_null<VarDecl>(DS->getSingleDecl())) {
----------------
I think we'll need to check for multiple declarators here:
```
register int x asm("eax"), y asm("ebx");
```
And do we need to check for an initializer? For example, the following should
not be allowed:
```
register int x asm("eax") = g();
```
It would also be nice to have a comment explaining why these are Ok but not
other declarations.
https://reviews.llvm.org/D24193
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits