rnk added a comment.

The code looks good and I'm happy to leave the naming as it is for now. 
Apparently MSVC is warning on these attributes and calling them "ATL 
attributes" now: https://msdn.microsoft.com/en-us/library/mt723604.aspx I'm not 
sure if that warning applies to all square-bracketed user defined attributes or 
not, but the naming is certainly confusing.

Even though this change doesn't change the behavior of the parser, I would feel 
more comfortable if we added a new test at 
test/SemaCXX/ms-square-bracket-attributes.cpp or something that exhaustively 
lists the ambiguities we know about and codifies how we diagnose them. That 
way, if someone accidentally changes behavior in this area, we'll know about 
it. This seems like a good starting point for the test:

  void local_class() {
    // FIXME: MSVC accepts, but we reject due to ambiguity.
    // expected-error@+1 {{expected body of lambda expression}}
    [uuid("a5a7bd07-3b14-49bc-9399-de066d4d72cd")] struct Local {
      int x;
    };
  }
  
  void useit(int);
  
  int lambda() {
    int uuid = 42;
    [uuid]() {
      useit(uuid);
    }();
  }


https://reviews.llvm.org/D23895



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to