[llvm-bugs] [Bug 40147] New: Clang does not use the unqualified version of return type for C11 program.

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Dec 23 07:13:17 PST 2018


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

            Bug ID: 40147
           Summary: Clang does not use the unqualified version of return
                    type for C11 program.
           Product: clang
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: anders.granlund.0 at gmail.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
                    neeilans at live.com, richard-llvm at metafoo.co.uk

Test case (prog.c):

  int main()
  {
    typedef const int t();
    typedef int t();
  }

Compilation command line:

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

Observed behaviour:

  The following error message was outputed:

    error: typedef redefinition with different types ('int ()' vs
           'const int ()') typedef int t();

Expected behaviour:

  No error message. Both typedefs should define t to be of type 'int ()' since
  function types never have qualified return types.

Standard references:

  6.7.6.3.5

Note:

  gcc does not give any errors for the program.

-- 
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/20181223/fb6dc54c/attachment.html>


More information about the llvm-bugs mailing list