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

            Bug ID: 40211
           Summary: c11: Accepts invalid program with function having
                    internal linkage used but not defined.
           Product: clang
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected], [email protected]

Test case (prog.c):

  static void f();

  int main()
  {
    f;
  }

Compilation command line:

  clang prog.c -Wall -Wextra -std=c11 -pedantic-errors

Observed behaviour:

  No error message outputed. Only warning messages outputed.

Expected bebehaviour:

  An error message outputed.

  The program is invalid by 6.9/3:

    "... Moreover, if an identifier declared with internal linkage is used in
an
     expression (other than as a part of the operand of a sizeof or _Alignof
     operator whose result is an integer constant), there shall be exactly one
     external definition for the identifier in the translation unit."

Note:

  GCC gives the expected error message.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to