Bug 53760

Summary: JSC fails to build with TOT Clang
Product: WebKit Reporter: Cameron Zwarich (cpst) <zwarich>
Component: JavaScriptCoreAssignee: Cameron Zwarich (cpst) <zwarich>
Status: RESOLVED FIXED    
Severity: Normal CC: andersca, ggaren, zwarich
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: OS X 10.5   
Attachments:
Description Flags
Proposed patch mitz: review+, zwarich: commit-queue-

Description Cameron Zwarich (cpst) 2011-02-03 23:30:20 PST
Building JSC gives the following error (amongst others):

CompileC /Volumes/Data/symroots/JavaScriptCore.build/Debug/JavaScriptCore.build/Objects-normal/x86_64/Arguments.o runtime/Arguments.cpp normal x86_64 c++ com.apple.compilers.gcc.4_2
    cd /Volumes/Data/WebKit-OpenSource/Source/JavaScriptCore
    setenv LANG en_US.US-ASCII
    /Developer/usr/bin/gcc-4.2 -x c++ -arch x86_64 -fmessage-length=0 -pipe -Wno-trigraphs -fno-exceptions -fno-rtti -fpascal-strings -fasm-blocks -O0 -Werror -Wmissing-prototypes -Wnon-virtual-dtor -Wnewline-eof -DHAVE_DTRACE=1 -DWEBKIT_VERSION_MIN_REQUIRED=WEBKIT_VERSION_LATEST -DHAVE_HEADER_DETECTION_H -fstrict-aliasing -fvisibility-inlines-hidden -fno-threadsafe-statics -mmacosx-version-min=10.6 -gdwarf-2 -I/Volumes/Data/symroots/JavaScriptCore.build/Debug/JavaScriptCore.build/JavaScriptCore.hmap -Wall -Wextra -Wcast-qual -Wchar-subscripts -Wextra-tokens -Wformat=2 -Winit-self -Wmissing-format-attribute -Wmissing-noreturn -Wpacked -Wpointer-arith -Wredundant-decls -Wundef -Wwrite-strings -F/Volumes/Data/symroots/Debug -I/Volumes/Data/symroots/Debug/include -I/Volumes/Data/symroots/Debug/DerivedSources/JavaScriptCore -I. -Iicu -I/Volumes/Data/symroots/JavaScriptCore.build/Debug/JavaScriptCore.build/DerivedSources/x86_64 -I/Volumes/Data/symroots/JavaScriptCore.build/Debug/JavaScriptCore.build/DerivedSources -include /var/folders/1t/1tFPZz2zFG8060hthPyLrk+++TI/-Caches-/com.apple.Xcode.501/SharedPrecompiledHeaders/JavaScriptCorePrefix-auvrpfrvjgzoucgqyebkkitidjdk/JavaScriptCorePrefix.h -c /Volumes/Data/WebKit-OpenSource/Source/JavaScriptCore/runtime/Arguments.cpp -o /Volumes/Data/symroots/JavaScriptCore.build/Debug/JavaScriptCore.build/Objects-normal/x86_64/Arguments.o

In file included from /Volumes/Data/WebKit-OpenSource/Source/JavaScriptCore/runtime/Arguments.cpp:26:
/Volumes/Data/WebKit-OpenSource/Source/JavaScriptCore/runtime/Arguments.h:110:22: error: 'JSC::Arguments::put' hides overloaded virtual function [-Woverloaded-virtual]
        virtual void put(ExecState*, unsigned propertyName, JSValue, PutPropertySlot&);
                     ^
In file included from /Volumes/Data/WebKit-OpenSource/Source/JavaScriptCore/runtime/Arguments.cpp:26:
In file included from /Volumes/Data/WebKit-OpenSource/Source/JavaScriptCore/runtime/Arguments.h:27:
In file included from /Volumes/Data/WebKit-OpenSource/Source/JavaScriptCore/runtime/JSActivation.h:32:
In file included from /Volumes/Data/WebKit-OpenSource/Source/JavaScriptCore/bytecode/CodeBlock.h:33:
In file included from /Volumes/Data/WebKit-OpenSource/Source/JavaScriptCore/bytecode/EvalCodeCache.h:32:
In file included from /Volumes/Data/WebKit-OpenSource/Source/JavaScriptCore/runtime/Executable.h:30:
In file included from /Volumes/Data/WebKit-OpenSource/Source/JavaScriptCore/runtime/JSFunction.h:27:
In file included from /Volumes/Data/WebKit-OpenSource/Source/JavaScriptCore/runtime/JSObjectWithGlobalObject.h:29:
/Volumes/Data/WebKit-OpenSource/Source/JavaScriptCore/runtime/JSObject.h:113:22: note: hidden overloaded virtual function 'JSC::JSObject::put' declared here
        virtual void put(ExecState*, unsigned propertyName, JSValue value);
                     ^
1 error generated.

We use the idiom of adding new variants of an overloaded virtual function in derived classes throughout JSC, mostly with put() and getOwnProperty() functions. Perhaps we should give the overloaded versions a different name so we can keep the otherwise useful warning enabled?
Comment 1 Geoffrey Garen 2011-02-03 23:42:10 PST
I thin in most cases we can get rid of the custom overload. For example, in the arguments case, I don't think there's any reason to take a PutPropertySlot argument.
Comment 2 Cameron Zwarich (cpst) 2011-02-04 00:19:43 PST
I've got a patch that gets rid of the custom overloads in JSC. I just need to do more testing.
Comment 3 Cameron Zwarich (cpst) 2011-02-13 02:05:29 PST
Created attachment 82255 [details]
Proposed patch
Comment 4 Cameron Zwarich (cpst) 2011-02-13 02:24:22 PST
Landed in r78428. I'm building a new Clang to see if nothing else has been introduced before closing this.
Comment 5 Cameron Zwarich (cpst) 2011-02-13 03:13:43 PST
Verified that JSC builds with Clang r125450.