[LLVMbugs] [Bug 22934] New: Unknown identifier in _Generic throws obscure compiler error message

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Mar 17 05:27:16 PDT 2015


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: unassignedclangbugs at nondot.org
          Reporter: ed at 80386.nl
                CC: llvmbugs at cs.uiuc.edu
    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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20150317/9a1af6da/attachment.html>


More information about the llvm-bugs mailing list