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

            Bug ID: 39656
           Summary: [sema] Missing warning for name mangling changes on
                    noexcept function signatures.
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangb...@nondot.org
          Reporter: matthew.da...@sony.com
                CC: blitzrak...@gmail.com, dgre...@apple.com,
                    erik.pilking...@gmail.com, llvm-bugs@lists.llvm.org,
                    richard-l...@metafoo.co.uk

The warning -Wc++17-compat-mangling seems to be missing the case of func2 in
the example below: 

// Example
void func1(void (*)() noexcept) {}          // Expected warning.
void func2(void (*)(void (*)() noexcept)){} // No warning, is this overlooked?

I get the following warning, as expected, for func1 but not for func2:
"warning: mangled name of 'func1' will change in C++17 due to non-throwing
exception"

I believe that the compiler should be warning of the mangling change for func2.
 The noexcept will produce a slightly different mangled symbol name for func2
between c++14 and c++17 dialects:

test.14.o: // --std=c++14
0000000000000020 T _Z5func1PFvvE
0000000000000010 T _Z5func2PFvPFvvEE

test.17.o: // --std=c++17
0000000000000020 T _Z5func1PDoFvvE
0000000000000010 T _Z5func2PFvPDoFvvEE

It looks like the code in Sema::CheckFunctionDeclaration is not recursively
inspecting the types of the formal parameters.  Perhaps that is intentional?

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

Reply via email to