WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
39945
Compilation error with clang in JSDOMBinding.h
https://bugs.webkit.org/show_bug.cgi?id=39945
Summary
Compilation error with clang in JSDOMBinding.h
Olivier Goffart
Reported
2010-05-31 02:12:47 PDT
webkit/WebCore/bindings/js/JSDOMBinding.h:229:20: error: no viable conversion from 'WebCore::JSNode *' to 'JSC::JSValue' webkit/JavaScriptCore/runtime/JSValue.h:807:21: note: candidate constructor not viable: cannot convert argument of incomplete type 'WebCore::JSNode *' to 'JSC::JSCell *' inline JSValue::JSValue(JSCell* ptr) JSNode is only forward declared at this point. And since neither "wrapper" nor JSValue are type-dependent. Compilers should report errors at the first compilation pass. The fix is to move the conversion the line above, as the call to the function getCachedDOMNodeWrapper is type-dependent, the conversion will happen at template-instantiation time. See also
http://llvm.org/bugs/show_bug.cgi?id=7244
Attachments
Patch
(53 bytes, text/plain)
2010-05-31 02:19 PDT
,
Olivier Goffart
no flags
Details
Patch
(1.55 KB, patch)
2010-05-31 02:21 PDT
,
Olivier Goffart
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Olivier Goffart
Comment 1
2010-05-31 02:19:14 PDT
Created
attachment 57441
[details]
Patch
Olivier Goffart
Comment 2
2010-05-31 02:21:00 PDT
Created
attachment 57442
[details]
Patch
Benjamin Poulain
Comment 3
2010-05-31 02:25:50 PDT
Adding Oliver, he can probably review the patch.
Oliver Hunt
Comment 4
2010-05-31 09:58:42 PDT
Comment on
attachment 57442
[details]
Patch Why doesn't this fail in gcc or msvc? (i'm removing the r+ to prevent commit bot shenanigans till i understand thwe issue)
Darin Adler
Comment 5
2010-05-31 10:10:54 PDT
(In reply to
comment #4
)
> Why doesn't this fail in gcc or msvc? (i'm removing the r+ to prevent commit bot shenanigans till i understand thwe issue)
Here’s my understanding: The older compilers don't implement as much checking at template-definition time as clang does. These older C++ compilers tended to treat templates more like macros and not do much checking on them until the template was instantiated. But the C++ standard allows (perhaps requires) additional checking at the time the template is defined. On the other hand, I was led to believe that some folks have successfully compiled this code with at least some version of clang, so this may simply be a mistake in a certain version of clang rather than correct behavior.
Oliver Hunt
Comment 6
2010-05-31 10:49:53 PDT
Comment on
attachment 57442
[details]
Patch r=me as well then
WebKit Commit Bot
Comment 7
2010-05-31 15:16:37 PDT
Comment on
attachment 57442
[details]
Patch Clearing flags on attachment: 57442 Committed
r60451
: <
http://trac.webkit.org/changeset/60451
>
WebKit Commit Bot
Comment 8
2010-05-31 15:16:44 PDT
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug