https://llvm.org/bugs/show_bug.cgi?id=22934

            Bug ID: 22934
           Summary: Unknown identifier in _Generic throws obscure compiler
                    error message
           Product: clang
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

Consider the following piece of code:

void banana(void);
int main() {
  _Generic(hello, int: banana)();
}

This shouldn't compile, as "hello" is undeclared. Clang 3.4.1 will throw the
following compiler error:

bla.c:3:12: error: use of undeclared identifier 'hello'
  _Generic(hello, int: banana)();
           ^
1 error generated.

Now fast forward to:

clang version 3.7.0 (trunk 232255)

we see that Clang generates the following error:

bla.c:3:31: error: called object type '<dependent type>' is not a function or
function pointer
  _Generic(hello, int: banana)();
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
1 error generated.

It is no longer obvious what causes compilation to fail.

-- 
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