http://llvm.org/bugs/show_bug.cgi?id=14081

             Bug #: 14081
           Summary: [microsoft] sema for __noop is fairly wrong
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified


Eli pointed out in an email that

template<typename T> static void f() { T x = 10; }
void g() { __noop(f<void>()); }

is an interesting case for __noop that compiles with cl but not with clang.

__noop has a few other interesting cases too:

* `int __noop = 4` is a syntax error in cl; __noop is a keyword

* `int a = __noop(42, 56);` assigns 0 to a, but so does `int a = __noop;`. All
of the following are valid, all but the first assign 0 to a:

  __noop;
  a = __noop;
  a = __noop();
  a = (__noop)();
  a = (__noop);
  a = (__noop());
  a = ((__noop)());
  a = ((__noop))();

* __noop is converted to pointers like a 0 literal:

  int (*f2)() = __noop;  // works, but just assings 0 to f2

* ...but it's not a constant expression:

  int arr[__noop() + 1];  // errors out

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to