Support root namespace in namespace attribute
diff --git a/syntax/qualified.rs b/syntax/qualified.rs
index 5eefb8d..96f07c1 100644
--- a/syntax/qualified.rs
+++ b/syntax/qualified.rs
@@ -10,14 +10,14 @@
     pub fn parse_unquoted(input: ParseStream) -> Result<Self> {
         let mut segments = Vec::new();
         let mut trailing_punct = true;
-        input.parse::<Option<Token![::]>>()?;
+        let leading_colons: Option<Token![::]> = input.parse()?;
         while trailing_punct && input.peek(Ident::peek_any) {
             let ident = Ident::parse_any(input)?;
             segments.push(ident);
             let colons: Option<Token![::]> = input.parse()?;
             trailing_punct = colons.is_some();
         }
-        if segments.is_empty() {
+        if segments.is_empty() && leading_colons.is_none() {
             return Err(input.error("expected path"));
         } else if trailing_punct {
             return Err(input.error("expected path segment"));
@@ -28,7 +28,12 @@
     pub fn parse_quoted_or_unquoted(input: ParseStream) -> Result<Self> {
         if input.peek(LitStr) {
             let lit: LitStr = input.parse()?;
-            lit.parse_with(Self::parse_unquoted)
+            if lit.value().is_empty() {
+                let segments = Vec::new();
+                Ok(QualifiedName { segments })
+            } else {
+                lit.parse_with(Self::parse_unquoted)
+            }
         } else {
             Self::parse_unquoted(input)
         }
diff --git a/tests/ui/root_namespace.rs b/tests/ui/root_namespace.rs
new file mode 100644
index 0000000..886fbd9
--- /dev/null
+++ b/tests/ui/root_namespace.rs
@@ -0,0 +1,13 @@
+#[cxx::bridge]
+mod ffi {
+    #[namespace = "::"]
+    extern "Rust" {}
+
+    #[namespace = ""]
+    extern "Rust" {}
+
+    #[namespace = ]
+    extern "Rust" {}
+}
+
+fn main() {}
diff --git a/tests/ui/root_namespace.stderr b/tests/ui/root_namespace.stderr
new file mode 100644
index 0000000..ed07e66
--- /dev/null
+++ b/tests/ui/root_namespace.stderr
@@ -0,0 +1,5 @@
+error: unexpected token: `]`
+ --> $DIR/root_namespace.rs:9:19
+  |
+9 |     #[namespace = ]
+  |                   ^