Bug 163599 - [GTK] REGRESSION(r207396 and r207521) Build broken with Clang 3.6
Summary: [GTK] REGRESSION(r207396 and r207521) Build broken with Clang 3.6
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: 163494
  Show dependency treegraph
 
Reported: 2016-10-18 09:44 PDT by Carlos Alberto Lopez Perez
Modified: 2016-10-19 07:11 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Alberto Lopez Perez 2016-10-18 09:44:13 PDT
After r207396: <http://trac.webkit.org/changeset/207396> the GTK build with Clang 3.6 fails with:

../../Source/WebCore/css/CSSPrimitiveValue.cpp:939:16: error: no matching constructor for initialization of 'WTF::String'
        return String { valueName(m_value.valueID) };
               ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../Source/WTF/wtf/text/WTFString.h:97:27: note: candidate constructor not viable: no known conversion from 'const WTF::AtomicString' to 'const UChar *' (aka 'const unsigned short *') for 1st argument
                          String(const UChar*);
                          ^
../../Source/WTF/wtf/text/WTFString.h:104:27: note: candidate constructor not viable: no known conversion from 'const WTF::AtomicString' to 'const LChar *' (aka 'const unsigned char *') for 1st argument
                          String(const LChar* characters);
                          ^
../../Source/WTF/wtf/text/WTFString.h:105:27: note: candidate constructor not viable: no known conversion from 'const WTF::AtomicString' to 'const char *' for 1st argument
                          String(const char* characters);
                          ^
../../Source/WTF/wtf/text/WTFString.h:117:27: note: candidate constructor not viable: no known conversion from 'const WTF::AtomicString' to 'WTF::ASCIILiteral' for 1st argument
                          String(ASCIILiteral characters);
                          ^
../../Source/WTF/wtf/text/WTFString.h:127:5: note: candidate constructor not viable: no known conversion from 'const WTF::AtomicString' to 'const WTF::String &' for 1st argument
    String(const String& other)
    ^
../../Source/WTF/wtf/text/WTFString.h:130:5: note: candidate constructor not viable: no known conversion from 'const WTF::AtomicString' to 'WTF::String &&' for 1st argument
    String(String&& other)
    ^
../../Source/WTF/wtf/text/WTFString.h:455:5: note: candidate constructor not viable: no known conversion from 'const WTF::AtomicString' to 'WTF::HashTableDeletedValueType' for 1st argument
    String(WTF::HashTableDeletedValueType) : m_impl(WTF::HashTableDeletedValue) { }
    ^
../../Source/WTF/wtf/text/WTFString.h:521:16: note: candidate constructor not viable: no known conversion from 'const WTF::AtomicString' to 'WTF::StringImpl &' for 1st argument
inline String::String(StringImpl& impl)
               ^
../../Source/WTF/wtf/text/WTFString.h:526:16: note: candidate constructor not viable: no known conversion from 'const WTF::AtomicString' to 'WTF::StringImpl *' for 1st argument
inline String::String(StringImpl* impl)
               ^
../../Source/WTF/wtf/text/WTFString.h:531:16: note: candidate constructor not viable: no known conversion from 'const WTF::AtomicString' to 'Ref<WTF::StringImpl>' for 1st argument
inline String::String(Ref<StringImpl>&& impl)
               ^
../../Source/WTF/wtf/text/WTFString.h:536:16: note: candidate constructor not viable: no known conversion from 'const WTF::AtomicString' to 'RefPtr<WTF::StringImpl>' for 1st argument
inline String::String(RefPtr<StringImpl>&& impl)
               ^
../../Source/WTF/wtf/text/WTFString.h:541:16: note: candidate constructor not viable: no known conversion from 'const WTF::AtomicString' to 'Ref<WTF::AtomicStringImpl>' for 1st argument
inline String::String(Ref<AtomicStringImpl>&& impl)
               ^
../../Source/WTF/wtf/text/WTFString.h:546:16: note: candidate constructor not viable: no known conversion from 'const WTF::AtomicString' to 'RefPtr<WTF::AtomicStringImpl>' for 1st argument
inline String::String(RefPtr<AtomicStringImpl>&& impl)
               ^
../../Source/WTF/wtf/text/WTFString.h:552:9: note: candidate template ignored: could not match 'Vector<unsigned short, inlineCapacity, type-parameter-0-1, 16>' against 'const WTF::AtomicString'
String::String(const Vector<UChar, inlineCapacity, OverflowHandler>& vector)
        ^
../../Source/WTF/wtf/text/WTFString.h:123:5: note: candidate constructor template not viable: requires 2 arguments, but 1 was provided
    String(const char (&characters)[charactersCount], ConstructFromLiteralTag) : m_impl(StringImpl::createFromLiteral<charactersCount>(characters)) { }
    ^
../../Source/WTF/wtf/text/WTFString.h:80:5: note: candidate constructor not viable: requires 0 arguments, but 1 was provided
    String() { }
    ^
../../Source/WTF/wtf/text/WTFString.h:101:27: note: candidate constructor not viable: requires 2 arguments, but 1 was provided
                          String(const char* characters, unsigned length);
                          ^
../../Source/WTF/wtf/text/WTFString.h:100:27: note: candidate constructor not viable: requires 2 arguments, but 1 was provided
                          String(const LChar* characters, unsigned length);
                          ^
../../Source/WTF/wtf/text/WTFString.h:83:27: note: candidate constructor not viable: requires 2 arguments, but 1 was provided
                          String(const UChar* characters, unsigned length);
                          ^
../../Source/WebCore/css/CSSPrimitiveValue.cpp:941:16: error: no matching constructor for initialization of 'WTF::String'
        return String { propertyName(m_value.propertyID) };
               ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../Source/WTF/wtf/text/WTFString.h:97:27: note: candidate constructor not viable: no known conversion from 'const WTF::AtomicString' to 'const UChar *' (aka 'const unsigned short *') for 1st argument
                          String(const UChar*);
                          ^
../../Source/WTF/wtf/text/WTFString.h:104:27: note: candidate constructor not viable: no known conversion from 'const WTF::AtomicString' to 'const LChar *' (aka 'const unsigned char *') for 1st argument
                          String(const LChar* characters);
                          ^
../../Source/WTF/wtf/text/WTFString.h:105:27: note: candidate constructor not viable: no known conversion from 'const WTF::AtomicString' to 'const char *' for 1st argument
                          String(const char* characters);
                          ^
../../Source/WTF/wtf/text/WTFString.h:117:27: note: candidate constructor not viable: no known conversion from 'const WTF::AtomicString' to 'WTF::ASCIILiteral' for 1st argument
                          String(ASCIILiteral characters);
                          ^
../../Source/WTF/wtf/text/WTFString.h:127:5: note: candidate constructor not viable: no known conversion from 'const WTF::AtomicString' to 'const WTF::String &' for 1st argument
    String(const String& other)
    ^
../../Source/WTF/wtf/text/WTFString.h:130:5: note: candidate constructor not viable: no known conversion from 'const WTF::AtomicString' to 'WTF::String &&' for 1st argument
    String(String&& other)
    ^
../../Source/WTF/wtf/text/WTFString.h:455:5: note: candidate constructor not viable: no known conversion from 'const WTF::AtomicString' to 'WTF::HashTableDeletedValueType' for 1st argument
    String(WTF::HashTableDeletedValueType) : m_impl(WTF::HashTableDeletedValue) { }
    ^
../../Source/WTF/wtf/text/WTFString.h:521:16: note: candidate constructor not viable: no known conversion from 'const WTF::AtomicString' to 'WTF::StringImpl &' for 1st argument
inline String::String(StringImpl& impl)
               ^
../../Source/WTF/wtf/text/WTFString.h:526:16: note: candidate constructor not viable: no known conversion from 'const WTF::AtomicString' to 'WTF::StringImpl *' for 1st argument
inline String::String(StringImpl* impl)
               ^
../../Source/WTF/wtf/text/WTFString.h:531:16: note: candidate constructor not viable: no known conversion from 'const WTF::AtomicString' to 'Ref<WTF::StringImpl>' for 1st argument
inline String::String(Ref<StringImpl>&& impl)
               ^
../../Source/WTF/wtf/text/WTFString.h:536:16: note: candidate constructor not viable: no known conversion from 'const WTF::AtomicString' to 'RefPtr<WTF::StringImpl>' for 1st argument
inline String::String(RefPtr<StringImpl>&& impl)
               ^
../../Source/WTF/wtf/text/WTFString.h:541:16: note: candidate constructor not viable: no known conversion from 'const WTF::AtomicString' to 'Ref<WTF::AtomicStringImpl>' for 1st argument
inline String::String(Ref<AtomicStringImpl>&& impl)
               ^
../../Source/WTF/wtf/text/WTFString.h:546:16: note: candidate constructor not viable: no known conversion from 'const WTF::AtomicString' to 'RefPtr<WTF::AtomicStringImpl>' for 1st argument
inline String::String(RefPtr<AtomicStringImpl>&& impl)
               ^
../../Source/WTF/wtf/text/WTFString.h:552:9: note: candidate template ignored: could not match 'Vector<unsigned short, inlineCapacity, type-parameter-0-1, 16>' against 'const WTF::AtomicString'
String::String(const Vector<UChar, inlineCapacity, OverflowHandler>& vector)
        ^
../../Source/WTF/wtf/text/WTFString.h:123:5: note: candidate constructor template not viable: requires 2 arguments, but 1 was provided
    String(const char (&characters)[charactersCount], ConstructFromLiteralTag) : m_impl(StringImpl::createFromLiteral<charactersCount>(characters)) { }
    ^
../../Source/WTF/wtf/text/WTFString.h:80:5: note: candidate constructor not viable: requires 0 arguments, but 1 was provided
    String() { }
    ^
../../Source/WTF/wtf/text/WTFString.h:101:27: note: candidate constructor not viable: requires 2 arguments, but 1 was provided
                          String(const char* characters, unsigned length);
                          ^
../../Source/WTF/wtf/text/WTFString.h:100:27: note: candidate constructor not viable: requires 2 arguments, but 1 was provided
                          String(const LChar* characters, unsigned length);
                          ^
../../Source/WTF/wtf/text/WTFString.h:83:27: note: candidate constructor not viable: requires 2 arguments, but 1 was provided
                          String(const UChar* characters, unsigned length);
                          ^
2 errors generated.



It builds fine with GCC.
Comment 1 Darin Adler 2016-10-18 17:02:19 PDT
This should work:

    return String { valueName(m_value.valueID).string() };

Not sure why it’s not needed on older compilers.
Comment 2 Carlos Alberto Lopez Perez 2016-10-18 18:01:35 PDT
Tested. The patch below fixes the build:


--- a/Source/WebCore/css/CSSPrimitiveValue.cpp
+++ b/Source/WebCore/css/CSSPrimitiveValue.cpp
@@ -936,9 +936,9 @@ ExceptionOr<String> CSSPrimitiveValue::getStringValue() const
     case CSS_FONT_FAMILY:
         return String { m_value.fontFamily->familyName };
     case CSS_VALUE_ID:
-        return String { valueName(m_value.valueID) };
+        return String { valueName(m_value.valueID).string() };
     case CSS_PROPERTY_ID:
-        return String { propertyName(m_value.propertyID) };
+        return String { propertyName(m_value.propertyID).string() };
     default:
         return Exception { INVALID_ACCESS_ERR };
     }
Comment 3 Carlos Alberto Lopez Perez 2016-10-18 18:02:33 PDT
Will you land it, or do you prefer me to do it? Thanks
Comment 4 Darin Adler 2016-10-18 22:16:03 PDT
I would like you to do it. Thanks!
Comment 5 Carlos Alberto Lopez Perez 2016-10-19 03:45:08 PDT
Committed r207533: <http://trac.webkit.org/changeset/207533>
Comment 6 Carlos Alberto Lopez Perez 2016-10-19 07:11:44 PDT
More info about this issue:

It turns out that after fixing this, r207521 caused again a build failure related to the issue.

It seem this is caused because Clang 3.6 doesn't implement http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1591

See: https://llvm.org/bugs/show_bug.cgi?id=23904 and https://llvm.org/bugs/show_bug.cgi?id=24694


The code could be patched as follows to make it build:

--- a/Source/WebCore/testing/Internals.cpp
+++ b/Source/WebCore/testing/Internals.cpp
@@ -1156,7 +1156,7 @@ ExceptionOr<String> Internals::configurationForViewport(float devicePixelRatio,
     restrictMinimumScaleFactorToViewportSize(attributes, IntSize(availableWidth, availableHeight), devicePixelRatio);
     restrictScaleFactorToInitialScaleIfNotUserScalable(attributes);
 
-    return String { "viewport size " + String::number(attributes.layoutSize.width()) + "x" + String::number(attributes.layoutSize.height()) + " scale " + String::number(attributes.initialScale) + " with limits [" + String::number(attributes.minimumScale) + ", " + String::number(attributes.maximumScale) + "] and userScalable " + (attributes.userScalable ? "true" : "false") };
+    return String("viewport size " + String::number(attributes.layoutSize.width()) + "x" + String::number(attributes.layoutSize.height()) + " scale " + String::number(attributes.initialScale) + " with limits [" + String::number(attributes.minimumScale) + ", " + String::number(attributes.maximumScale) + "] and userScalable " + (attributes.userScalable ? "true" : "false"));
 }
 
 ExceptionOr<bool> Internals::wasLastChangeUserEdit(Element& textField)
@@ -1218,7 +1218,7 @@ ExceptionOr<String> Internals::autofillFieldName(Element& element)
     if (!is<HTMLFormControlElement>(element))
         return Exception { INVALID_NODE_TYPE_ERR };
 
-    return String { downcast<HTMLFormControlElement>(element).autofillData().fieldName };
+    return String { downcast<HTMLFormControlElement>(element).autofillData().fieldName.string() };
 }
 
 ExceptionOr<void> Internals::paintControlTints()



But reached this point, I don't think is worth.

On the GTK port we only need to support GCC, and this build just fine with GCC 4.9 which is the minimum version of GCC that we support.

Using clang is a personal choice, and I have just upgraded to Clang 3.8 that build this just fine.

I advice to anyone also having problems to upgrade the version of Clang.

Just a heads up.